Update JSON examples for JSON 1.81+

This commit is contained in:
Peter Dimov
2024-09-09 20:23:58 +03:00
parent 777bdec2e9
commit 18e7c01359
2 changed files with 10 additions and 0 deletions

View File

@@ -5,11 +5,14 @@
#include <boost/describe.hpp>
#include <boost/mp11.hpp>
#include <boost/json.hpp>
#include <boost/version.hpp>
#include <type_traits>
namespace app
{
#if BOOST_VERSION < 108100
template<class T> void extract( boost::json::object const & obj, char const * name, T & value )
{
value = boost::json::value_to<T>( obj.at( name ) );
@@ -36,6 +39,8 @@ template<class T,
return t;
}
#endif
struct A
{
int x;

View File

@@ -5,6 +5,7 @@
#include <boost/describe.hpp>
#include <boost/mp11.hpp>
#include <boost/json.hpp>
#include <boost/version.hpp>
#include <type_traits>
#include <vector>
#include <map>
@@ -12,6 +13,8 @@
namespace app
{
#if BOOST_VERSION < 108100
template<class T,
class D1 = boost::describe::describe_members<T,
boost::describe::mod_public | boost::describe::mod_protected>,
@@ -29,6 +32,8 @@ template<class T,
});
}
#endif
struct A
{
int x;