@@ -82,6 +82,17 @@ struct basic_variant :
8282 basic_variant () {}
8383 template <typename T>
8484 basic_variant (T const & t):base(t) {}
85+
86+ #if defined(_MSC_VER) && _MSC_VER < 1700
87+ // The following redundant functions are required to avoid MSVC
88+ // See https://svn.boost.org/trac/boost/ticket/592
89+ basic_variant (basic_variant const & other):base(static_cast <base const &>(other)) {}
90+ basic_variant& operator =(basic_variant const & other) {
91+ *static_cast <base*>(this ) = static_cast <base const &>(other);
92+ return *this ;
93+ }
94+ #endif // defined(_MSC_VER) && _MSC_VER < 1700
95+
8596 basic_variant (char const * p):base(std::string(p)) {}
8697 basic_variant (char v) {
8798 int_init (v);
@@ -104,51 +115,51 @@ struct basic_variant :
104115 basic_variant (unsigned long long v):base(uint64_t (v)) {}
105116
106117 bool is_nil () const {
107- return boost::get<msgpack::type::nil_t >(this );
118+ return boost::get<msgpack::type::nil_t >(this ) != nullptr ;
108119 }
109120 bool is_bool () const {
110- return boost::get<bool >(this );
121+ return boost::get<bool >(this ) != nullptr ;
111122 }
112123 bool is_int64_t () const {
113- return boost::get<int64_t >(this );
124+ return boost::get<int64_t >(this ) != nullptr ;
114125 }
115126 bool is_uint64_t () const {
116- return boost::get<uint64_t >(this );
127+ return boost::get<uint64_t >(this ) != nullptr ;
117128 }
118129 bool is_double () const {
119- return boost::get<double >(this );
130+ return boost::get<double >(this ) != nullptr ;
120131 }
121132 bool is_string () const {
122- return boost::get<std::string>(this );
133+ return boost::get<std::string>(this ) != nullptr ;
123134 }
124135#if (BOOST_VERSION / 100000) >= 1 && ((BOOST_VERSION / 100) % 1000) >= 53
125136 bool is_boost_string_ref () const {
126- return boost::get<boost::string_ref>(this );
137+ return boost::get<boost::string_ref>(this ) != nullptr ;
127138 }
128139#endif // (BOOST_VERSION / 100000) >= 1 && ((BOOST_VERSION / 100) % 1000) >= 53
129140 bool is_vector_char () const {
130- return boost::get<std::vector<char > >(this );
141+ return boost::get<std::vector<char > >(this ) != nullptr ;
131142 }
132143 bool is_vector_char () {
133- return boost::get<std::vector<char > >(this );
144+ return boost::get<std::vector<char > >(this ) != nullptr ;
134145 }
135146 bool is_raw_ref () const {
136- return boost::get<raw_ref>(this );
147+ return boost::get<raw_ref>(this ) != nullptr ;
137148 }
138149 bool is_ext () const {
139- return boost::get<ext>(this );
150+ return boost::get<ext>(this ) != nullptr ;
140151 }
141152 bool is_ext_ref () const {
142- return boost::get<ext_ref>(this );
153+ return boost::get<ext_ref>(this ) != nullptr ;
143154 }
144155 bool is_vector () const {
145- return boost::get<std::vector<basic_variant<STR, BIN, EXT> > >(this );
156+ return boost::get<std::vector<basic_variant<STR, BIN, EXT> > >(this ) != nullptr ;
146157 }
147158 bool is_map () const {
148- return boost::get<std::map<basic_variant<STR, BIN, EXT>, basic_variant<STR, BIN, EXT> > >(this );
159+ return boost::get<std::map<basic_variant<STR, BIN, EXT>, basic_variant<STR, BIN, EXT> > >(this ) != nullptr ;
149160 }
150161 bool is_multimap () const {
151- return boost::get<std::multimap<basic_variant<STR, BIN, EXT>, basic_variant<STR, BIN, EXT> > >(this );
162+ return boost::get<std::multimap<basic_variant<STR, BIN, EXT>, basic_variant<STR, BIN, EXT> > >(this ) != nullptr ;
152163 }
153164
154165 bool as_bool () const {
0 commit comments