diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-03-08 14:18:59 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-03-08 14:50:24 +0100 |
commit | 845f1e2c61640f3118f5e6ee0a3ebd9d043ee5d2 (patch) | |
tree | 7d787ba866751c6ccd2ad4e4feb21150698a7878 /tests/test_tuple_cdr.cc | |
parent | a231515b9981035a03e71725647e4c5f2b11e587 (diff) | |
download | sigc++-845f1e2c61640f3118f5e6ee0a3ebd9d043ee5d2.tar.gz |
tuple_cdr(), tuple_start(), tuple_end(): Use of constexpr.
Diffstat (limited to 'tests/test_tuple_cdr.cc')
-rw-r--r-- | tests/test_tuple_cdr.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_tuple_cdr.cc b/tests/test_tuple_cdr.cc index 12c9650..028a15f 100644 --- a/tests/test_tuple_cdr.cc +++ b/tests/test_tuple_cdr.cc @@ -66,11 +66,26 @@ test_tuple_cdr_stdref() { assert(std::get<1>(t_suffix) == "world"); } +constexpr +void +test_tuple_cdr_constexpr() { + constexpr auto str_hello = "hello"; + constexpr auto str_world = "world"; + + constexpr auto t_larger = + std::make_tuple(nullptr, str_hello, str_world); + constexpr auto t_suffix = sigc::internal::tuple_cdr(t_larger); + assert(std::get<0>(t_suffix) == str_hello); + assert(std::get<1>(t_suffix) == str_world); +} + int main() { test_tuple_type_cdr(); test_tuple_cdr(); test_tuple_cdr_stdref(); + test_tuple_cdr_constexpr(); + return EXIT_SUCCESS; } |