From 276b9a93c2e3b9ac58a9ddb5fff4c8299c459222 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 17 Sep 2018 11:10:12 +0200 Subject: add nlohmann modenjson --- include/lib/modernjson/detail/meta/detected.hpp | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 include/lib/modernjson/detail/meta/detected.hpp (limited to 'include/lib/modernjson/detail/meta/detected.hpp') diff --git a/include/lib/modernjson/detail/meta/detected.hpp b/include/lib/modernjson/detail/meta/detected.hpp new file mode 100644 index 0000000..78b25d5 --- /dev/null +++ b/include/lib/modernjson/detail/meta/detected.hpp @@ -0,0 +1,56 @@ +#pragma once + +#include + +#include + +// http://en.cppreference.com/w/cpp/experimental/is_detected +namespace nlohmann +{ +namespace detail +{ +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + void operator=(nonesuch const&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template