Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Vinnie Falco vinniefalco

🏠
Working from home
Block or report user

Report or block vinniefalco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:23e29719f4d0a54f01f8929c2b86f72d
void
value::
swap(value& other)
{
if(*get_storage() != *other.get_storage())
{
value temp1(
std::move(*this),
other.get_storage());
value temp2(
View gist:6eb5bd62cfd0a33e6deb21e59d720a66
rapidjson parse 55952763 bytes in 223ms
rapidjson parse 55952763 bytes in 223ms
rapidjson parse 55952763 bytes in 223ms
nlohmann parse 55952763 bytes in 513ms
nlohmann parse 55952763 bytes in 519ms
nlohmann parse 55952763 bytes in 521ms
Boost.JSON parse 55952763 bytes in 235ms
Boost.JSON parse 55952763 bytes in 232ms
Boost.JSON parse 55952763 bytes in 208ms
rapidjson parse 488889121 bytes in 1782ms
View gist:874880378f27bd2cb1471b4566bafacb
//
// Copyright (c) 2019 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/vinniefalco/json
//
View gist:f061936b04888f48855aa56bddea0f31
boost.json.basic_parser
sizeof(basic_parser) == 136
'i' number_double_huge_neg_exp accept
'i' number_huge_exp accept
'i' number_neg_int_huge_exp accept
'i' number_pos_double_huge_exp accept
'i' number_real_neg_overflow accept
'i' number_real_pos_overflow accept
'i' number_real_underflow accept
'i' number_too_big_neg_int reject
View gist:d416eefae1bc2d317c1dc712d75db2eb
static
int
utf8_encode(
char* dest,
unsigned long cp)
{
if(cp < 0x80)
{
dest[0] = static_cast<char>(cp);
View gist:c693a08bf010bcec5eb5f91aaf6e62da
// handles 1 or 2 surrogates
case state::u_surr:
{
// one code unit
if(u0_ == -1)
{
if( u_ >= 0xd800)
{
if(u_ <= 0xdbff)
{
View gist:66250943b8bd4dd94ffa0b0f1e569182
// handles 1 or 2 surrogates
case state::u_surr:
{
// one code unit
if(u0_ == -1)
{
if( u_ >= 0xd800 &&
u_ < 0xdbff)
{
// need 2nd surrogate
View gist:36217366050765bc8102acb827a0ab19
// handles 1 or 2 surrogates
case state::u_surr:
{
if(u0_ == -1)
{
if( u_ >= 0xd800 &&
u_ < 0xe000)
{
// need 2nd surrogate
u0_ = u_;
View gist:8aa223f5e18ad2fdabb0b22a3eed4b27
C:\Users\vinnie\src\boost\boost/json/storage.hpp(30): warning C4251: 'boost::json::storage::refs_': struct 'std::atomic<unsigned int>' needs to have dll-interface to be used by clients of class 'boost::json::storage'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\xxatomic(162): note: see declaration of 'std::atomic<unsigned int>'
C:\Users\vinnie\src\boost\boost/json/array.hpp(81): warning C4251: 'boost::json::array::sp_': class 'boost::json::basic_storage_ptr<boost::json::storage>' needs to have dll-interface to be used by clients of class 'boost::json::array'
C:\Users\vinnie\src\boost\boost/json/storage.hpp(227): note: see declaration of 'boost::json::basic_storage_ptr<boost::json::storage>'
C:\Users\vinnie\src\boost\boost/json/object.hpp(173): warning C4251: 'boost::json::object::sp_': class 'boost::json::basic_storage_ptr<boost::json::storage>' needs to have dll-interface to be used by clients of class 'boost::json::object'
C:\Users\vinnie\src\boost\boost/js
View gist:0beb9e5ce6f6b154a17329ac00896033
#if defined(GENERATING_DOCUMENTATION)
# define BOOST_JSON_DECL
#elif defined(BOOST_JSON_HEADER_ONLY)
# define BOOST_JSON_DECL inline
#else
# if (defined(BOOST_JSON_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_JSON_STATIC_LINK)
# if defined(BOOST_JSON_SOURCE)
# define BOOST_JSON_DECL BOOST_SYMBOL_EXPORT
# define BOOST_JSON_BUILD_DLL
# else
You can’t perform that action at this time.