@@ -53,18 +53,50 @@ DECLARE_VARIANT_TRAIT(long int, Int64);
5353DECLARE_VARIANT_TRAIT (long long int , Int64);
5454DECLARE_VARIANT_TRAIT (float , Float);
5555DECLARE_VARIANT_TRAIT (double , Double);
56+ DECLARE_VARIANT_TRAIT (bool , Bool);
57+
5658DECLARE_VARIANT_TRAIT (const char *, String);
5759DECLARE_VARIANT_TRAIT (char *, String);
5860DECLARE_VARIANT_TRAIT (char * const , String);
5961DECLARE_VARIANT_TRAIT (const char * const , String);
6062DECLARE_VARIANT_TRAIT (std::string_view, String);
6163DECLARE_VARIANT_TRAIT (std::string, String);
62- DECLARE_VARIANT_TRAIT ( bool , Bool);
64+
6365DECLARE_VARIANT_TRAIT (int *, ArrayInt);
6466DECLARE_VARIANT_TRAIT (float *, ArrayFloat);
6567DECLARE_VARIANT_TRAIT (double *, ArrayDouble);
6668DECLARE_VARIANT_TRAIT (bool *, ArrayBool);
6769
70+ DECLARE_VARIANT_TRAIT (std::vector<int >, ArrayInt);
71+ DECLARE_VARIANT_TRAIT (std::vector<float >, ArrayFloat);
72+ DECLARE_VARIANT_TRAIT (std::vector<double >, ArrayDouble);
73+ DECLARE_VARIANT_TRAIT (std::vector<bool >, ArrayBool);
74+
75+ template <typename T>
76+ struct variant_array_symbol {
77+ constexpr static char symbol = ' u' ;
78+ };
79+
80+ template <>
81+ struct variant_array_symbol <int > {
82+ constexpr static char symbol = ' i' ;
83+ };
84+
85+ template <>
86+ struct variant_array_symbol <float > {
87+ constexpr static char symbol = ' f' ;
88+ };
89+
90+ template <>
91+ struct variant_array_symbol <double > {
92+ constexpr static char symbol = ' d' ;
93+ };
94+
95+ template <>
96+ struct variant_array_symbol <bool > {
97+ constexpr static char symbol = ' b' ;
98+ };
99+
68100template <typename T>
69101inline constexpr VariantType variant_trait_v = variant_trait<T>::value;
70102
@@ -84,6 +116,7 @@ DECLARE_VARIANT_TYPE(float, Float);
84116DECLARE_VARIANT_TYPE (double , Double);
85117DECLARE_VARIANT_TYPE (const char *, String);
86118DECLARE_VARIANT_TYPE (bool , Bool);
119+
87120DECLARE_VARIANT_TYPE (int *, ArrayInt);
88121DECLARE_VARIANT_TYPE (float *, ArrayFloat);
89122DECLARE_VARIANT_TYPE (double *, ArrayDouble);
@@ -293,6 +326,7 @@ class Variant
293326
294327 VariantType type () const { return mType ; }
295328 size_t size () const { return mSize ; }
329+ std::string asString () const ;
296330
297331 private:
298332 friend std::ostream& operator <<(std::ostream& oss, Variant const & val);
0 commit comments