diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/boost/libs/python/test/string_literal.cpp | |
parent | Initial commit. (diff) | |
download | ceph-6d07fdb6bb33b1af39833b850bb6cf8af79fe293.tar.xz ceph-6d07fdb6bb33b1af39833b850bb6cf8af79fe293.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/python/test/string_literal.cpp')
-rw-r--r-- | src/boost/libs/python/test/string_literal.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/boost/libs/python/test/string_literal.cpp b/src/boost/libs/python/test/string_literal.cpp new file mode 100644 index 000000000..7a349d6c2 --- /dev/null +++ b/src/boost/libs/python/test/string_literal.cpp @@ -0,0 +1,42 @@ +// Copyright David Abrahams 2004. 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) +#include <boost/python/detail/string_literal.hpp> +//#include <stdio.h> + +#include <boost/detail/lightweight_test.hpp> +#include <boost/static_assert.hpp> + +using namespace boost::python::detail; + + +template <class T> +void expect_string_literal(T const&) +{ + BOOST_STATIC_ASSERT(is_string_literal<T const>::value); +} + +int main() +{ + expect_string_literal("hello"); + BOOST_STATIC_ASSERT(!is_string_literal<int*&>::value); + BOOST_STATIC_ASSERT(!is_string_literal<int* const&>::value); + BOOST_STATIC_ASSERT(!is_string_literal<int*volatile&>::value); + BOOST_STATIC_ASSERT(!is_string_literal<int*const volatile&>::value); + + BOOST_STATIC_ASSERT(!is_string_literal<char const*>::value); + BOOST_STATIC_ASSERT(!is_string_literal<char*>::value); + BOOST_STATIC_ASSERT(!is_string_literal<char*&>::value); + BOOST_STATIC_ASSERT(!is_string_literal<char* const&>::value); + BOOST_STATIC_ASSERT(!is_string_literal<char*volatile&>::value); + BOOST_STATIC_ASSERT(!is_string_literal<char*const volatile&>::value); + + BOOST_STATIC_ASSERT(!is_string_literal<char[20]>::value); + BOOST_STATIC_ASSERT(is_string_literal<char const[20]>::value); + BOOST_STATIC_ASSERT(is_string_literal<char const[3]>::value); + + BOOST_STATIC_ASSERT(!is_string_literal<int[20]>::value); + BOOST_STATIC_ASSERT(!is_string_literal<int const[20]>::value); + BOOST_STATIC_ASSERT(!is_string_literal<int const[3]>::value); + return boost::report_errors(); +} |