Sha256: 3b4ed2983b5e5e1a80d304a99156740164c1e9cb49015dc83e51d5fc1719e9fe

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 KB

Contents

// Copyright (c) 2018-2022 Dr. Colin Hirsch and Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/json/

#ifndef TAO_JSON_BINDING_MEMBER_HPP
#define TAO_JSON_BINDING_MEMBER_HPP

#include <string>

#include "element.hpp"
#include "element2.hpp"
#include "member_kind.hpp"

#include "internal/type_key.hpp"

namespace tao::json::binding
{
   template< member_kind R, typename K, auto P >
   struct member
      : element< P >,
        internal::type_key< K, typename binding::element< P >::value_t >
   {
      static constexpr member_kind kind = R;

      template< template< typename... > class Traits, typename C >
      [[nodiscard]] static bool is_nothing( const C& x )
      {
         return json::internal::is_nothing< Traits >( binding::element< P >::read( x ) );
      }
   };

   template< member_kind R, typename K, auto G, auto S >
   struct member2
      : element2< G, S >,
        internal::type_key< K, typename binding::element2< G, S >::value_t >
   {
      static constexpr member_kind kind = R;

      template< template< typename... > class Traits, typename C >
      [[nodiscard]] static bool is_nothing( const C& x )
      {
         return json::internal::is_nothing< Traits >( binding::element2< G, S >::read( x ) );
      }
   };

}  // namespace tao::json::binding

#endif

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
couchbase-3.4.5 ext/couchbase/third_party/json/include/tao/json/binding/member.hpp
couchbase-3.4.4 ext/couchbase/third_party/json/include/tao/json/binding/member.hpp
couchbase-3.4.3 ext/couchbase/third_party/json/include/tao/json/binding/member.hpp
couchbase-3.4.2 ext/couchbase/third_party/json/include/tao/json/binding/member.hpp
couchbase-3.4.1 ext/couchbase/third_party/json/include/tao/json/binding/member.hpp
couchbase-3.4.0 ext/couchbase/third_party/json/include/tao/json/binding/member.hpp
couchbase-3.3.0 ext/couchbase/third_party/json/include/tao/json/binding/member.hpp