diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
| commit | 53a420fba21cf1644972b34dcd811a43cdb8368d (patch) | |
| tree | 66a19f6f8b65215772549a51d688492ab8addc0d /test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp | |
| parent | b50f1549701eb950921e5d6f2e55ba1a1dadbb43 (diff) | |
Notes
Diffstat (limited to 'test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp')
| -rw-r--r-- | test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp index 352ecfc602be..8d454723320c 100644 --- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp +++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // <functional> +// REQUIRES-ANY: c++98, c++03, c++11, c++14 // class function<R(ArgTypes...)> @@ -16,11 +17,24 @@ #include <functional> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" #include "test_allocator.h" #include "count_new.hpp" #include "../function_types.h" + +#if TEST_STD_VER >= 11 +struct RValueCallable { + template <class ...Args> + void operator()(Args&&...) && {} +}; +struct LValueCallable { + template <class ...Args> + void operator()(Args&&...) & {} +}; +#endif + class DummyClass {}; template <class FuncType, class AllocType> @@ -103,4 +117,14 @@ int main() non_default_test_allocator<DummyClass> non_default_alloc(42); test_for_alloc(non_default_alloc); } +#if TEST_STD_VER >= 11 + { + using Fn = std::function<void(int, int, int)>; + static_assert(std::is_constructible<Fn, std::allocator_arg_t, std::allocator<int>, LValueCallable&>::value, ""); + static_assert(std::is_constructible<Fn, std::allocator_arg_t, std::allocator<int>, LValueCallable>::value, ""); + static_assert(!std::is_constructible<Fn, std::allocator_arg_t, std::allocator<int>, RValueCallable&>::value, ""); + static_assert(!std::is_constructible<Fn, std::allocator_arg_t, std::allocator<int>, RValueCallable>::value, ""); + } +#endif + } |
