]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/hana/example/string/to.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / example / string / to.cpp
index 660af0f08bc527541326d8f238a9baa4a4458f84..16109a235cc23d9e4bf075950501801744d4fabf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright Louis Dionne 2013-2016
+// Copyright Louis Dionne 2013-2017
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
 
@@ -9,7 +9,13 @@ namespace hana = boost::hana;
 
 
 constexpr auto str = hana::string_c<'h', 'i'>;
-constexpr char const* s = hana::to<char const*>(str);
-static_assert(s[0] == 'h' && s[1] == 'i' && s[2] == '\0', "");
+
+// using c_str()
+constexpr char const* s1 = str.c_str();
+static_assert(s1[0] == 'h' && s1[1] == 'i' && s1[2] == '\0', "");
+
+// using hana::to
+constexpr char const* s2 = hana::to<char const*>(str);
+static_assert(s2[0] == 'h' && s2[1] == 'i' && s2[2] == '\0', "");
 
 int main() { }