17 #include <type_traits> 30 size_t rrefs = 0, crefs = 0;
31 void something(MyData&&) {
34 void something(
const MyData&) {
43 worker.something(data);
48 TEST_F(UtilityTest, copy_noexcept_spec) {
49 struct MyNoexceptCopyable {};
50 MyNoexceptCopyable noe;
54 struct MyThrowingCopyable {
55 MyThrowingCopyable() {}
56 MyThrowingCopyable(
const MyThrowingCopyable&)
noexcept(
false) {}
57 MyThrowingCopyable(MyThrowingCopyable&&) =
default;
59 MyThrowingCopyable thr;
82 return const_cast<T&
>(
t);
89 EXPECT_EQ(&x, std::addressof(folly::forward_like<char&>(x)));
94 auto obj = std::map<std::string, int>{{
"hello", 3}};
95 auto old =
exchange(obj, {{
"world", 4}});
96 EXPECT_EQ((std::map<std::string, int>{{
"world", 4}}), obj);
97 EXPECT_EQ((std::map<std::string, int>{{
"hello", 3}}), old);
100 TEST(FollyIntegerSequence, core) {
102 static_assert(seq.size() == 3,
"");
109 static_assert(seq3.
size() == 3,
"");
129 "Should not be copy constructible");
140 "Should have noexcept move constructor");
static constexpr std::size_t size() noexcept
TEST_F(TestInfoTest, Names)
#define EXPECT_EQ(val1, val2)
constexpr detail::Map< Move > move
Gen seq(Value first, Value last)
requires E e noexcept(noexcept(s.error(std::move(e))))
constexpr T const & as_const(T &t) noexcept
constexpr auto to_unsigned(T const &t) -> typename std::make_unsigned< T >::type
constexpr std::decay< T >::type copy(T &&value) noexcept(noexcept(typename std::decay< T >::type(std::forward< T >(value))))
static T & as_mutable(T const &t)
TEST_F(UtilityTest, copy)
constexpr like_t< Src, Dst > && forward_like(Dst &&dst) noexcept
make_integer_sequence< std::size_t, Size > make_index_sequence
static const char *const value
constexpr auto to_signed(T const &t) -> typename std::make_signed< T >::type
std::enable_if< ExprIsConst< Constness >::value, Map >::type member(Return(Class::*member)() const)
#define EXPECT_TRUE(condition)
T exchange(T &obj, U &&new_value)
moveonly_::MoveOnly MoveOnly
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::detail::as_const_fn as_const
#define EXPECT_FALSE(condition)
decltype(auto) constexpr apply(F &&func, Tuple &&tuple)
static constexpr uint64_t data[1]
TEST(FollyIntegerSequence, core)