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:95f24a2d13951d3ab7ec35f6746c81b4
//
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.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/url
//
// Test that header file is self-contained.
View gist:321fa14be50ed162e0e2134ef2ddd8e3
//
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.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/url
//
#include <boost/url/detail/char_type.hpp>
View gist:f83c1290aeb5d8b9e438cd022d40a46b
void
testAuthority()
{
value u;
BEAST_EXPECT(u.encoded_authority() == "");
u.set_username("joe");
BEAST_EXPECT(u.encoded_authority() == "joe@");
u.set_password("password");
BEAST_EXPECT(u.encoded_authority() == "joe:password@");
u.set_hostname("example.com");
View gist:b5ede35e39e5e94f6fdb571ba237f8e9
template<class T>
T
number_cast(
value const& jv,
error_code& ec,
typename std::enable_if<
std::is_floating_point<T>::value
>::type* = 0
) noexcept
{
View gist:04efe112d2ce155a47ea21350b1fa148
/** Returns a value converted to a numeric type.
This function attempts to convert a @ref value to
the numeric type `T`. If the conversion is not
possible or the result would not be exact, an
exception is thrown.
@par Constraints
@code
View gist:b6c7ed80539566daefec05ff3b470e6e
template<class T>
T
number_cast(value const& jv, error_code& ec) noexcept
{
T result{};
if(! jv.is_number())
{
ec = error::not_number;
return result;
View gist:069e51b256829850eea54fa82522b2be
//
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.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/url
//
#ifndef BOOST_URL_STRING_HPP
View gist:4b50b61d4110df84481fce94bf6fb272
class encoded
{
string_view str_;
public:
explicit
encoded(string_view s)
: str_(s)
{
}
View gist:617836a19c75a6ba906a3273c326617f
<!DOCTYPE html>
<!--
Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.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
-->
<html>
View gist:07b3378189293b7e94f56b2333e91de0
parse, small.json, boost.pool, 2438000, 5000, 280
parse, small.json, rapidjson.memory, 2391000, 5000, 275
parse, small.json, boost.default, 1422000, 5001, 164
parse, small.json, rapidjson.crt, 2150000, 5001, 247
parse, small.json, nlohmann, 594000, 5003, 68
parse, random.json, boost.pool, 626000, 5002, 268
parse, random.json, rapidjson.memory, 707000, 5002, 302
parse, random.json, boost.default, 400000, 5011, 171
parse, random.json, rapidjson.crt, 679000, 5005, 290
parse, random.json, nlohmann, 166000, 5005, 71
You can’t perform that action at this time.