File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ Purpose: Generic serialization of object hierarchies.
17
17
#include < vector>
18
18
#include < set>
19
19
#include < map>
20
+ #include < cassert>
20
21
#ifdef USE_BOOST
21
22
#include < boost/bimap.hpp>
22
23
#endif
@@ -162,9 +163,7 @@ class serializert
162
163
traitst * result=dynamic_cast <traitst *>(traits);
163
164
if (result!=nullptr )
164
165
return *result;
165
- if (parent==nullptr )
166
- throw std::logic_error (
167
- " Traits of required type not found on this serializer" );
166
+ assert (parent!=nullptr ); // In release build allow undefined behaviour
168
167
return parent->get_traits <traitst>();
169
168
}
170
169
@@ -188,9 +187,7 @@ class serializert
188
187
\*******************************************************************/
189
188
void set_traits (serializer_traitst &serializer_traits)
190
189
{
191
- if (traits!=nullptr )
192
- throw std::logic_error (
193
- " Tried to set traits twice on the same serializert" );
190
+ assert (traits==nullptr );
194
191
traits=&serializer_traits;
195
192
}
196
193
You can’t perform that action at this time.
0 commit comments