diff --git rcore/aida.cc rcore/aida.cc index ca69e5f..42b8de9 100644 --- rcore/aida.cc +++ rcore/aida.cc @@ -322,13 +322,13 @@ ImplicitBase::~ImplicitBase() RAPICORN_STATIC_ASSERT (sizeof (std::string) <= sizeof (Any)); // assert big enough Any impl Any::Any (const Any &clone) : - Any() + Any (Fix1()) { this->operator= (clone); } Any::Any (Any &&other) : - Any() + Any (Fix1()) { this->swap (other); } diff --git rcore/aida.hh rcore/aida.hh index b77ca2f..54a07aa 100644 --- rcore/aida.hh +++ rcore/aida.hh @@ -204,6 +204,7 @@ public: // == Any Type == +struct Fix1 {}; class Any /// Generic value type that can hold values of all other types. { ///@cond @@ -275,13 +276,13 @@ private: void rekind (TypeKind _kind); public: /*dtor*/ ~Any (); ///< Any destructor. - explicit Any (); ///< Default initialize Any with no type. + explicit Any (const Fix1 &f = Fix1()); ///< Default initialize Any with no type. /// Initialize Any from a @a anany which is of Any or derived type. template::type >::value > = true> inline - explicit Any (V &&anany) : Any() { this->operator= (::std::forward (anany)); } + explicit Any (V &&anany) : Any (Fix1()) { this->operator= (::std::forward (anany)); } /// Initialize Any and set its contents from @a value. template::type >::value > = true> inline - explicit Any (V &&value) : Any() { set (::std::forward (value)); } + explicit Any (V &&value) : Any (Fix1()) { set (::std::forward (value)); } /*copy*/ Any (const Any &clone); ///< Copy constructor. /*move*/ Any (Any &&other); ///< Move constructor. Any& operator= (const Any &clone); ///< Set @a this Any to a copy of @a clone. @@ -755,7 +756,7 @@ struct ProtoScopeDisconnect : ProtoScope { // == inline implementations == inline -Any::Any() : +Any::Any (const Fix1&) : type_kind_ (UNTYPED), u_ {0} {}