mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 01:18:52 +08:00
[libcxx] [test] Untabify, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,13 +18,13 @@
|
||||
#include <cassert>
|
||||
|
||||
struct Tag {
|
||||
Tag() : val(0), tag("Default") {}
|
||||
Tag(int a, const char *b) : val(a), tag(b) {}
|
||||
~Tag() {}
|
||||
Tag() : val(0), tag("Default") {}
|
||||
Tag(int a, const char *b) : val(a), tag(b) {}
|
||||
~Tag() {}
|
||||
|
||||
int val;
|
||||
const char *tag;
|
||||
};
|
||||
int val;
|
||||
const char *tag;
|
||||
};
|
||||
|
||||
bool eq(const Tag& rhs, const Tag& lhs) { return rhs.val == lhs.val && rhs.tag == lhs.tag; }
|
||||
// bool operator==(const Tag& rhs, const Tag& lhs) { return rhs.val == lhs.val; }
|
||||
|
||||
@@ -23,24 +23,24 @@
|
||||
|
||||
#if TEST_STD_VER >= 11
|
||||
struct S {
|
||||
S() : i_(0) {}
|
||||
S(int i) : i_(i) {}
|
||||
S() : i_(0) {}
|
||||
S(int i) : i_(i) {}
|
||||
|
||||
S(const S& rhs) : i_(rhs.i_) {}
|
||||
S( S&& rhs) : i_(rhs.i_) { rhs.i_ = -1; }
|
||||
S(const S& rhs) : i_(rhs.i_) {}
|
||||
S( S&& rhs) : i_(rhs.i_) { rhs.i_ = -1; }
|
||||
|
||||
S& operator =(const S& rhs) { i_ = rhs.i_; return *this; }
|
||||
S& operator =( S&& rhs) { i_ = rhs.i_; rhs.i_ = -2; assert(this != &rhs); return *this; }
|
||||
S& operator =(int i) { i_ = i; return *this; }
|
||||
S& operator =(const S& rhs) { i_ = rhs.i_; return *this; }
|
||||
S& operator =( S&& rhs) { i_ = rhs.i_; rhs.i_ = -2; assert(this != &rhs); return *this; }
|
||||
S& operator =(int i) { i_ = i; return *this; }
|
||||
|
||||
bool operator <(const S& rhs) const { return i_ < rhs.i_; }
|
||||
bool operator ==(const S& rhs) const { return i_ == rhs.i_; }
|
||||
bool operator ==(int i) const { return i_ == i; }
|
||||
bool operator <(const S& rhs) const { return i_ < rhs.i_; }
|
||||
bool operator ==(const S& rhs) const { return i_ == rhs.i_; }
|
||||
bool operator ==(int i) const { return i_ == i; }
|
||||
|
||||
void set(int i) { i_ = i; }
|
||||
void set(int i) { i_ = i; }
|
||||
|
||||
int i_;
|
||||
};
|
||||
int i_;
|
||||
};
|
||||
#endif
|
||||
|
||||
std::mt19937 randomness;
|
||||
|
||||
@@ -33,25 +33,25 @@ struct indirect_less
|
||||
};
|
||||
|
||||
struct S {
|
||||
S() : i_(0) {}
|
||||
S(int i) : i_(i) {}
|
||||
S() : i_(0) {}
|
||||
S(int i) : i_(i) {}
|
||||
|
||||
S(const S& rhs) : i_(rhs.i_) {}
|
||||
S( S&& rhs) : i_(rhs.i_) { rhs.i_ = -1; }
|
||||
S(const S& rhs) : i_(rhs.i_) {}
|
||||
S( S&& rhs) : i_(rhs.i_) { rhs.i_ = -1; }
|
||||
|
||||
S& operator =(const S& rhs) { i_ = rhs.i_; return *this; }
|
||||
S& operator =( S&& rhs) { i_ = rhs.i_; rhs.i_ = -2; assert(this != &rhs); return *this; }
|
||||
S& operator =(int i) { i_ = i; return *this; }
|
||||
S& operator =(const S& rhs) { i_ = rhs.i_; return *this; }
|
||||
S& operator =( S&& rhs) { i_ = rhs.i_; rhs.i_ = -2; assert(this != &rhs); return *this; }
|
||||
S& operator =(int i) { i_ = i; return *this; }
|
||||
|
||||
bool operator <(const S& rhs) const { return i_ < rhs.i_; }
|
||||
bool operator >(const S& rhs) const { return i_ > rhs.i_; }
|
||||
bool operator ==(const S& rhs) const { return i_ == rhs.i_; }
|
||||
bool operator ==(int i) const { return i_ == i; }
|
||||
bool operator <(const S& rhs) const { return i_ < rhs.i_; }
|
||||
bool operator >(const S& rhs) const { return i_ > rhs.i_; }
|
||||
bool operator ==(const S& rhs) const { return i_ == rhs.i_; }
|
||||
bool operator ==(int i) const { return i_ == i; }
|
||||
|
||||
void set(int i) { i_ = i; }
|
||||
void set(int i) { i_ = i; }
|
||||
|
||||
int i_;
|
||||
};
|
||||
int i_;
|
||||
};
|
||||
|
||||
|
||||
#endif // TEST_STD_VER >= 11
|
||||
|
||||
@@ -87,8 +87,8 @@ struct less { constexpr bool operator ()( const int &x, const int &y) const { re
|
||||
void constexpr_test()
|
||||
{
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr auto p = std::min_element(il, il+8, less());
|
||||
static_assert(*p == 1, "");
|
||||
constexpr auto p = std::min_element(il, il+8, less());
|
||||
static_assert(*p == 1, "");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user