Skip to content

Commit

Permalink
Remove duplication of std::variant definition
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Oct 23, 2023
1 parent 5d2da38 commit 4521175
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 43 deletions.
4 changes: 2 additions & 2 deletions include/openPMD/auxiliary/Variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ namespace auxiliary
* @tparam T Varaidic template argument list of datatypes to be
* stored.
*/
template <class T_DTYPES, typename... T>
template <class T_DTYPES, typename std_variant>
class Variant
{
static_assert(
std::is_enum<T_DTYPES>::value,
"Datatypes to Variant must be supplied as enum.");

public:
using resource = std::variant<T...>;
using resource = std_variant;
/** Construct a lightweight wrapper around a generic object that
* indicates the concrete datatype of the specific object stored.
*
Expand Down
42 changes: 1 addition & 41 deletions include/openPMD/backend/Attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,47 +51,7 @@ namespace openPMD
* @note Extending and/or modifying the available formats requires identical
* modifications to Datatype.
*/
class Attribute
: public auxiliary::Variant<
Datatype,
char,
unsigned char,
signed char,
short,
int,
long,
long long,
unsigned short,
unsigned int,
unsigned long,
unsigned long long,
float,
double,
long double,
std::complex<float>,
std::complex<double>,
std::complex<long double>,
std::string,
std::vector<char>,
std::vector<short>,
std::vector<int>,
std::vector<long>,
std::vector<long long>,
std::vector<unsigned char>,
std::vector<unsigned short>,
std::vector<unsigned int>,
std::vector<unsigned long>,
std::vector<unsigned long long>,
std::vector<float>,
std::vector<double>,
std::vector<long double>,
std::vector<std::complex<float> >,
std::vector<std::complex<double> >,
std::vector<std::complex<long double> >,
std::vector<signed char>,
std::vector<std::string>,
std::array<double, 7>,
bool>
class Attribute : public auxiliary::Variant<Datatype, attribute_types>
{
public:
Attribute(resource r) : Variant(std::move(r))
Expand Down

0 comments on commit 4521175

Please sign in to comment.