Sha256: 279221e4a189759b1a7083baabab2adcc398b809930dcaa47202d3d516541fcb

Contents?: true

Size: 1.45 KB

Versions: 34

Compression:

Stored size: 1.45 KB

Contents

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

#ifndef TAO_JSON_CONSUME_HPP
#define TAO_JSON_CONSUME_HPP

#include <type_traits>

#include "forward.hpp"

#include "internal/type_traits.hpp"

namespace tao::json
{
   template< typename T, template< typename... > class Traits = traits, typename Producer >
   [[nodiscard]] std::enable_if_t< internal::has_consume_one< Traits, Producer, T >, T > consume( Producer& parser )
   {
      return Traits< T >::template consume< Traits >( parser );
   }

   template< typename T, template< typename... > class Traits = traits, typename Producer >
   [[nodiscard]] std::enable_if_t< !internal::has_consume_one< Traits, Producer, T >, T > consume( Producer& parser )
   {
      T t;
      Traits< T >::template consume< Traits >( parser, t );
      return t;
   }

   template< template< typename... > class Traits = traits, typename Producer, typename T >
   std::enable_if_t< internal::has_consume_two< Traits, Producer, T >, void > consume( Producer& parser, T& t )
   {
      Traits< T >::template consume< Traits >( parser, t );
   }

   template< template< typename... > class Traits = traits, typename Producer, typename T >
   std::enable_if_t< !internal::has_consume_two< Traits, Producer, T >, void > consume( Producer& parser, T& t )
   {
      t = Traits< T >::template consume< Traits >( parser );
   }

}  // namespace tao::json

#endif

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
couchbase-3.2.0-universal-darwin-20 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.2.0 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.1.1 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.1.1-universal-darwin-20 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.1.0 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.3 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.3-universal-darwin-20 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.2 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.1-universal-darwin-19 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.1 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0-universal-darwin-19 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0.beta.1-universal-darwin-19 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0.beta.1 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0.alpha.5-x86_64-linux ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0.alpha.5-universal-darwin-19 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0.alpha.5-x86_64-darwin-19 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0.alpha.5 ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0.alpha.4-x86_64-linux ext/third_party/json/include/tao/json/consume.hpp
couchbase-3.0.0.alpha.4-x86_64-darwin-19 ext/third_party/json/include/tao/json/consume.hpp