From: Adam C. Emerson Date: Wed, 26 Jul 2017 22:08:32 +0000 (-0400) Subject: common: Add in_place_t/in_place_type_t from C++17 X-Git-Tag: v13.0.0~153^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=49f3d58b493932e592206ab75e6db416c85dcb41;p=ceph.git common: Add in_place_t/in_place_type_t from C++17 To better signal in-place construction among other overloads. Signed-off-by: Adam C. Emerson --- diff --git a/src/common/backport14.h b/src/common/backport14.h index 3e6505d468d31..5e55d714a1aaf 100644 --- a/src/common/backport14.h +++ b/src/common/backport14.h @@ -118,11 +118,27 @@ not_fn_result not_fn(F&& fn) { return not_fn_result(std::forward(fn)); } +struct in_place_t {}; +constexpr in_place_t in_place{}; + +template +struct in_place_type_t {}; + +#ifdef __cpp_variable_templates +template +constexpr in_place_type_t in_place_type{}; +#endif // __cpp_variable_templates } // namespace _backport17 using _backport14::make_unique; using _backport17::size; using _backport14::max; using _backport17::not_fn; +using _backport17::in_place_t; +using _backport17::in_place; +using _backport17::in_place_type_t; +#ifdef __cpp_variable_templates +using _backport17::in_place_type; +#endif // __cpp_variable_templates } // namespace ceph #endif // CEPH_COMMON_BACKPORT14_H