#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
class A
int g(int) {return 0;}
+#if TEST_STD_VER >= 11
+struct RValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) && {}
+};
+struct LValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) & {}
+};
+#endif
+
int main()
{
assert(globalMemCounter.checkOutstandingNewEq(0));
std::function <void()> f(static_cast<void (*)()>(0));
assert(!f);
}
+#if TEST_STD_VER >= 11
+ {
+ using Fn = std::function<void(int, int, int)>;
+ static_assert(std::is_constructible<Fn, LValueCallable&>::value, "");
+ static_assert(std::is_constructible<Fn, LValueCallable>::value, "");
+ static_assert(!std::is_constructible<Fn, RValueCallable&>::value, "");
+ static_assert(!std::is_constructible<Fn, RValueCallable>::value, "");
+ }
+#endif
}
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
class A
int g(int) {return 0;}
+#if TEST_STD_VER >= 11
+struct RValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) && {}
+};
+struct LValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) & {}
+};
+#endif
+
int main()
{
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(f.target<int(*)(int)>() != 0);
f(1);
}
+#if TEST_STD_VER >= 11
+ {
+ using Fn = std::function<void(int, int, int)>;
+ static_assert(std::is_assignable<Fn&, LValueCallable&>::value, "");
+ static_assert(std::is_assignable<Fn&, LValueCallable>::value, "");
+ static_assert(!std::is_assignable<Fn&, RValueCallable&>::value, "");
+ static_assert(!std::is_assignable<Fn&, RValueCallable>::value, "");
+ }
+#endif
}
#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>
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
+
}
<tr><td><a href="http://wg21.link/LWG2310">2310</a></td><td>Public exposition only member in std::array</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2312">2312</a></td><td>tuple's constructor constraints need to be phrased more precisely</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2328">2328</a></td><td>Rvalue stream extraction should use perfect forwarding</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2393">2393</a></td><td>std::function's Callable definition is broken</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2393">2393</a></td><td>std::function's Callable definition is broken</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2422">2422</a></td><td>std::numeric_limits<T>::is_modulo description: "most machines" errata</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2426">2426</a></td><td>Issue about compare_exchange</td><td>Oulu</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2436">2436</a></td><td>Comparators for associative containers should always be CopyConstructible</td><td>Oulu</td><td>Complete</td></tr>