Skip to content

Commit 8012590

Browse files
committed
Merge branch 'master' of github.com:5cript/SimpleJSON into HEAD
2 parents b5858b4 + 787cd37 commit 8012590

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

parse/jsd_optional.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ namespace JSON
1010
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS)
1111
{
1212
try
13-
{
14-
auto opt = object.tree.get_optional <T> (name);
15-
if (!opt)
16-
return; // its ok, it was optional
17-
else
18-
value = opt.get();
13+
{
14+
if (object.tree.get_optional <std::string> (name))
15+
{
16+
T v;
17+
parse(v, name, object, options);
18+
value = v;
19+
}
1920
}
2021
catch (boost::property_tree::ptree_bad_data& exc)
2122
{

utility/meta_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace JSON
113113
template <typename... List>
114114
struct cexpr_string
115115
{
116-
using size_type = std::make_signed_t <std::size_t>;
116+
using size_type = std::make_signed <std::size_t>::type;
117117

118118
using type = pack <List...>;
119119
constexpr static const size_type size = sizeof...(List);

0 commit comments

Comments
 (0)