mirror of
https://github.com/boostorg/describe.git
synced 2026-01-19 16:12:19 +00:00
Update JSON examples for JSON 1.81+
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user