Sha256: 573d84839fa0d59cfda5477ac12c1e736073b4b31a314d1787ae01be401a27ed

Contents?: true

Size: 676 Bytes

Versions: 7

Compression:

Stored size: 676 Bytes

Contents

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

#ifndef TAO_JSON_EVENTS_PREFER_UNSIGNED_HPP
#define TAO_JSON_EVENTS_PREFER_UNSIGNED_HPP

#include <cstdint>

namespace tao::json::events
{
   template< typename Consumer >
   struct prefer_unsigned
      : Consumer
   {
      using Consumer::Consumer;

      using Consumer::number;

      void number( const std::int64_t v )
      {
         if( v >= 0 ) {
            Consumer::number( std::uint64_t( v ) );
         }
         else {
            Consumer::number( v );
         }
      }
   };

}  // namespace tao::json::events

#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/events/prefer_unsigned.hpp
couchbase-3.4.4 ext/couchbase/third_party/json/include/tao/json/events/prefer_unsigned.hpp
couchbase-3.4.3 ext/couchbase/third_party/json/include/tao/json/events/prefer_unsigned.hpp
couchbase-3.4.2 ext/couchbase/third_party/json/include/tao/json/events/prefer_unsigned.hpp
couchbase-3.4.1 ext/couchbase/third_party/json/include/tao/json/events/prefer_unsigned.hpp
couchbase-3.4.0 ext/couchbase/third_party/json/include/tao/json/events/prefer_unsigned.hpp
couchbase-3.3.0 ext/couchbase/third_party/json/include/tao/json/events/prefer_unsigned.hpp