tomlplusplus/tests/impl_toml.cpp
Mark Gillard cd9b3d2198 fixed some multi-line string parsing issues
also:
- fixed pedantic warnings on gcc 10 and clang 11
2020-04-13 23:23:11 +03:00

49 lines
2.4 KiB
C++

#if !defined(_MSC_VER) || !defined(_M_IX86)
#define TOML_ALL_INLINE 0
#define TOML_IMPLEMENTATION
#endif
#include "../include/toml++/toml_preprocessor.h"
TOML_PUSH_WARNINGS
TOML_DISABLE_ALL_WARNINGS
#ifdef TARTANLLAMA_OPTIONAL
#if __has_include(<tloptional/include/tl/optional.hpp>)
#include <tloptional/include/tl/optional.hpp>
#else
#error TartanLlama/optional is missing! You probably need to fetch submodules ("git submodule update --init extern/tloptional")
#endif
#define TOML_OPTIONAL_TYPE tl::optional
#endif
#include <ostream>
TOML_POP_WARNINGS
#include "../include/toml++/toml.h"
namespace toml
{
using std::declval;
using std::is_same_v;
static_assert(is_same_v<decltype(declval<node&>().ref<double>()), double&>);
static_assert(is_same_v<decltype(declval<node&&>().ref<double>()), double&&>);
static_assert(is_same_v<decltype(declval<const node&>().ref<double>()), const double&>);
static_assert(is_same_v<decltype(declval<node&>().ref<value<double>>()), double&>);
static_assert(is_same_v<decltype(declval<node&&>().ref<value<double>>()), double&&>);
static_assert(is_same_v<decltype(declval<const node&>().ref<value<double>>()), const double&>);
static_assert(is_same_v<decltype(declval<node&>().ref<table>()), table&>);
static_assert(is_same_v<decltype(declval<node&&>().ref<table>()), table&&>);
static_assert(is_same_v<decltype(declval<const node&>().ref<table>()), const table&>);
static_assert(is_same_v<decltype(declval<node&>().ref<array>()), array&>);
static_assert(is_same_v<decltype(declval<node&&>().ref<array>()), array&&>);
static_assert(is_same_v<decltype(declval<const node&>().ref<array>()), const array&>);
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<double>()), double&>);
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<double>()), const double&>);
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<value<double>>()), double&>);
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<value<double>>()), const double&>);
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<table>()), table&>);
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<table>()), const table&>);
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<array>()), array&>);
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<array>()), const array&>);
}