Skip to content

Commit

Permalink
Add missed MOVESET for simple types
Browse files Browse the repository at this point in the history
Without that my compiller GCC 9.3.0 says:
`undefined reference to `void picojson::value::set<double>(double&&)'`
when i try set any value like this:
```
picojson::value val();
val.set<double>(5.);
```
  • Loading branch information
lirik90 committed Apr 7, 2020
1 parent 5440d44 commit b4f2036
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions picojson.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,14 @@ SET(int64_t, int64, u_.int64_ = _val;)
type_ = jtype##_type; \
setter \
}
MOVESET(bool, boolean, u_.boolean_ = std::move(_val);)
MOVESET(std::string, string, u_.string_ = new std::string(std::move(_val));)
MOVESET(array, array, u_.array_ = new array(std::move(_val));)
MOVESET(object, object, u_.object_ = new object(std::move(_val));)
MOVESET(double, number, u_.number_ = std::move(_val);)
#ifdef PICOJSON_USE_INT64
MOVESET(int64_t, int64, u_.int64_ = std::move(_val);)
#endif
#undef MOVESET
#endif

Expand Down

0 comments on commit b4f2036

Please sign in to comment.