Skip to content

Commit 43a3256

Browse files
authored
Add ParmParse::Add for AMREX_NUM (#4765)
This will also enable `ParmParse::queryAdd`.
1 parent 0e3f40d commit 43a3256

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Src/Base/AMReX_ParmParse.H

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,16 @@ public:
13151315
return exist;
13161316
}
13171317

1318+
1319+
//! Add a key 'name' with value 'val' to the end of the ParmParse
1320+
//! database. Here T is an AMREX_ENUM type.
1321+
template <typename T, typename ET = amrex_enum_traits<T>,
1322+
std::enable_if_t<ET::value,int> = 0>
1323+
void add (std::string_view name, T const& val)
1324+
{
1325+
this->add(name, amrex::getEnumNameString(val));
1326+
}
1327+
13181328
/**
13191329
* \brief. Get enum value using given name.
13201330
*

0 commit comments

Comments
 (0)