🎨 fixed indentation

This commit is contained in:
Niels Lohmann 2019-03-28 14:23:26 +01:00
parent 23635704c3
commit d21d298397
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
2 changed files with 97 additions and 95 deletions

View file

@ -13,10 +13,11 @@ template <typename It, typename = void>
struct iterator_types {};
template <typename It>
struct iterator_types<
struct iterator_types <
It,
void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
typename It::reference, typename It::iterator_category>> {
typename It::reference, typename It::iterator_category >>
{
using difference_type = typename It::difference_type;
using value_type = typename It::value_type;
using pointer = typename It::pointer;
@ -32,13 +33,14 @@ struct iterator_traits
};
template <typename T>
struct iterator_traits<T, enable_if_t<!std::is_pointer<T>::value>>
struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
: iterator_types<T>
{
};
template <typename T>
struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>> {
struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
{
using iterator_category = std::random_access_iterator_tag;
using value_type = T;
using difference_type = ptrdiff_t;

View file

@ -24,43 +24,43 @@ using number_integer_function_t =
template <typename T, typename Unsigned>
using number_unsigned_function_t =
decltype(std::declval<T &>().number_unsigned(std::declval<Unsigned>()));
decltype(std::declval<T&>().number_unsigned(std::declval<Unsigned>()));
template <typename T, typename Float, typename String>
using number_float_function_t = decltype(std::declval<T &>().number_float(
std::declval<Float>(), std::declval<const String &>()));
using number_float_function_t = decltype(std::declval<T&>().number_float(
std::declval<Float>(), std::declval<const String&>()));
template <typename T, typename String>
using string_function_t =
decltype(std::declval<T &>().string(std::declval<String &>()));
decltype(std::declval<T&>().string(std::declval<String&>()));
template <typename T>
using start_object_function_t =
decltype(std::declval<T &>().start_object(std::declval<std::size_t>()));
decltype(std::declval<T&>().start_object(std::declval<std::size_t>()));
template <typename T, typename String>
using key_function_t =
decltype(std::declval<T &>().key(std::declval<String &>()));
decltype(std::declval<T&>().key(std::declval<String&>()));
template <typename T>
using end_object_function_t = decltype(std::declval<T &>().end_object());
using end_object_function_t = decltype(std::declval<T&>().end_object());
template <typename T>
using start_array_function_t =
decltype(std::declval<T &>().start_array(std::declval<std::size_t>()));
decltype(std::declval<T&>().start_array(std::declval<std::size_t>()));
template <typename T>
using end_array_function_t = decltype(std::declval<T &>().end_array());
using end_array_function_t = decltype(std::declval<T&>().end_array());
template <typename T, typename Exception>
using parse_error_function_t = decltype(std::declval<T &>().parse_error(
std::declval<std::size_t>(), std::declval<const std::string &>(),
std::declval<const Exception &>()));
using parse_error_function_t = decltype(std::declval<T&>().parse_error(
std::declval<std::size_t>(), std::declval<const std::string&>(),
std::declval<const Exception&>()));
template <typename SAX, typename BasicJsonType>
struct is_sax
{
private:
private:
static_assert(is_basic_json<BasicJsonType>::value,
"BasicJsonType must be of type basic_json<...>");
@ -70,7 +70,7 @@ private:
using string_t = typename BasicJsonType::string_t;
using exception_t = typename BasicJsonType::exception;
public:
public:
static constexpr bool value =
is_detected_exact<bool, null_function_t, SAX>::value &&
is_detected_exact<bool, boolean_function_t, SAX>::value &&
@ -92,7 +92,7 @@ public:
template <typename SAX, typename BasicJsonType>
struct is_sax_static_asserts
{
private:
private:
static_assert(is_basic_json<BasicJsonType>::value,
"BasicJsonType must be of type basic_json<...>");
@ -102,7 +102,7 @@ private:
using string_t = typename BasicJsonType::string_t;
using exception_t = typename BasicJsonType::exception;
public:
public:
static_assert(is_detected_exact<bool, null_function_t, SAX>::value,
"Missing/invalid function: bool null()");
static_assert(is_detected_exact<bool, boolean_function_t, SAX>::value,