Whitespace maintenance. Remove a bunch of tabs that snuck in. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220142 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow 2014-10-18 11:03:33 +00:00
parent 9b53c1095f
commit 38d9005902
17 changed files with 123 additions and 123 deletions

View File

@ -1430,7 +1430,7 @@ forward_list<_Tp, _Alloc>::remove(const value_type& __v)
iterator __j = _VSTD::next(__i, 2); iterator __j = _VSTD::next(__i, 2);
for (; __j != __e && *__j == __v; ++__j) for (; __j != __e && *__j == __v; ++__j)
; ;
__deleted_nodes.splice_after(__deleted_nodes.before_begin(), *this, __i, __j); __deleted_nodes.splice_after(__deleted_nodes.before_begin(), *this, __i, __j);
if (__j == __e) if (__j == __e)
break; break;
__i = __j; __i = __j;

View File

@ -1543,11 +1543,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
// is_destructible // is_destructible
// if it's a reference, return true // if it's a reference, return true
// if it's a function, return false // if it's a function, return false
// if it's void, return false // if it's void, return false
// if it's an array of unknown bound, return false // if it's an array of unknown bound, return false
// Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed // Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed
// where _Up is remove_all_extents<_Tp>::type // where _Up is remove_all_extents<_Tp>::type
template <class> template <class>
@ -1555,15 +1555,15 @@ struct __is_destructible_apply { typedef int type; };
template <typename _Tp> template <typename _Tp>
struct __is_destructor_wellformed { struct __is_destructor_wellformed {
template <typename _Tp1> template <typename _Tp1>
static char __test ( static char __test (
typename __is_destructible_apply<decltype(_VSTD::declval<_Tp1&>().~_Tp1())>::type typename __is_destructible_apply<decltype(_VSTD::declval<_Tp1&>().~_Tp1())>::type
); );
template <typename _Tp1> template <typename _Tp1>
static __two __test (...); static __two __test (...);
static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char); static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char);
}; };
template <class _Tp, bool> template <class _Tp, bool>

View File

@ -54,17 +54,17 @@
#include <chrono> // for nanoseconds #include <chrono> // for nanoseconds
struct NotTriviallyCopyable { struct NotTriviallyCopyable {
NotTriviallyCopyable ( int i ) : i_(i) {} NotTriviallyCopyable ( int i ) : i_(i) {}
NotTriviallyCopyable ( const NotTriviallyCopyable &rhs) : i_(rhs.i_) {} NotTriviallyCopyable ( const NotTriviallyCopyable &rhs) : i_(rhs.i_) {}
int i_; int i_;
}; };
template <class T> template <class T>
void test ( T t ) { void test ( T t ) {
std::atomic<T> t0(t); std::atomic<T> t0(t);
} }
int main() int main()
{ {
test(NotTriviallyCopyable(42)); test(NotTriviallyCopyable(42));
} }

View File

@ -56,18 +56,18 @@
#include <chrono> // for nanoseconds #include <chrono> // for nanoseconds
struct TriviallyCopyable { struct TriviallyCopyable {
TriviallyCopyable ( int i ) : i_(i) {} TriviallyCopyable ( int i ) : i_(i) {}
int i_; int i_;
}; };
template <class T> template <class T>
void test ( T t ) { void test ( T t ) {
std::atomic<T> t0(t); std::atomic<T> t0(t);
} }
int main() int main()
{ {
test(TriviallyCopyable(42)); test(TriviallyCopyable(42));
test(std::this_thread::get_id()); test(std::this_thread::get_id());
test(std::chrono::nanoseconds(2)); test(std::chrono::nanoseconds(2));
} }

View File

@ -18,14 +18,14 @@
#include "min_allocator.h" #include "min_allocator.h"
struct S { struct S {
S(int i) : i_(new int(i)) {} S(int i) : i_(new int(i)) {}
S(const S &rhs) : i_(new int(*rhs.i_)) {} S(const S &rhs) : i_(new int(*rhs.i_)) {}
S& operator = (const S &rhs) { *i_ = *rhs.i_; return *this; } S& operator = (const S &rhs) { *i_ = *rhs.i_; return *this; }
~S () { delete i_; i_ = NULL; } ~S () { delete i_; i_ = NULL; }
bool operator == (const S &rhs) const { return *i_ == *rhs.i_; } bool operator == (const S &rhs) const { return *i_ == *rhs.i_; }
int get () const { return *i_; } int get () const { return *i_; }
int *i_; int *i_;
}; };
int main() int main()
@ -98,10 +98,10 @@ int main()
c.remove(c.front()); c.remove(c.front());
C::const_iterator it = c.begin(); C::const_iterator it = c.begin();
for(int *ip = std::begin(t2); ip != std::end(t2); ++ip, ++it) { for(int *ip = std::begin(t2); ip != std::end(t2); ++ip, ++it) {
assert ( it != c.end()); assert ( it != c.end());
assert ( *ip == it->get()); assert ( *ip == it->get());
} }
assert ( it == c.end ()); assert ( it == c.end ());
} }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
{ {

View File

@ -17,14 +17,14 @@
#include "min_allocator.h" #include "min_allocator.h"
struct S { struct S {
S(int i) : i_(new int(i)) {} S(int i) : i_(new int(i)) {}
S(const S &rhs) : i_(new int(*rhs.i_)) {} S(const S &rhs) : i_(new int(*rhs.i_)) {}
S& operator = (const S &rhs) { *i_ = *rhs.i_; return *this; } S& operator = (const S &rhs) { *i_ = *rhs.i_; return *this; }
~S () { delete i_; i_ = NULL; } ~S () { delete i_; i_ = NULL; }
bool operator == (const S &rhs) const { return *i_ == *rhs.i_; } bool operator == (const S &rhs) const { return *i_ == *rhs.i_; }
int get () const { return *i_; } int get () const { return *i_; }
int *i_; int *i_;
}; };
int main() int main()
@ -52,10 +52,10 @@ int main()
c.remove(c.front()); c.remove(c.front());
std::list<S>::const_iterator it = c.begin(); std::list<S>::const_iterator it = c.begin();
for(int *ip = a2; ip < a2+5; ++ip, ++it) { for(int *ip = a2; ip < a2+5; ++ip, ++it) {
assert ( it != c.end()); assert ( it != c.end());
assert ( *ip == it->get()); assert ( *ip == it->get());
} }
assert ( it == c.end ()); assert ( it == c.end ());
} }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
{ {

View File

@ -33,24 +33,24 @@ int main()
ss >> i; ss >> i;
assert(i == 456); assert(i == 456);
} }
{ {
std::istringstream s1("Aaaaa Bbbbb Cccccccccc Dddddddddddddddddd"); std::istringstream s1("Aaaaa Bbbbb Cccccccccc Dddddddddddddddddd");
std::string s; std::string s;
s1 >> s; s1 >> s;
std::istringstream s2 = std::move(s1); std::istringstream s2 = std::move(s1);
s2 >> s; s2 >> s;
assert(s == "Bbbbb"); assert(s == "Bbbbb");
std::istringstream s3; std::istringstream s3;
s3 = std::move(s2); s3 = std::move(s2);
s3 >> s; s3 >> s;
assert(s == "Cccccccccc"); assert(s == "Cccccccccc");
s1 = std::move(s3); s1 = std::move(s3);
s1 >> s; s1 >> s;
assert(s == "Dddddddddddddddddd"); assert(s == "Dddddddddddddddddd");
} }
{ {
std::wistringstream ss0(L" 123 456"); std::wistringstream ss0(L" 123 456");
std::wistringstream ss; std::wistringstream ss;
@ -64,23 +64,23 @@ int main()
ss >> i; ss >> i;
assert(i == 456); assert(i == 456);
} }
{ {
std::wistringstream s1(L"Aaaaa Bbbbb Cccccccccc Dddddddddddddddddd"); std::wistringstream s1(L"Aaaaa Bbbbb Cccccccccc Dddddddddddddddddd");
std::wstring s; std::wstring s;
s1 >> s; s1 >> s;
std::wistringstream s2 = std::move(s1); std::wistringstream s2 = std::move(s1);
s2 >> s; s2 >> s;
assert(s == L"Bbbbb"); assert(s == L"Bbbbb");
std::wistringstream s3; std::wistringstream s3;
s3 = std::move(s2); s3 = std::move(s2);
s3 >> s; s3 >> s;
assert(s == L"Cccccccccc"); assert(s == L"Cccccccccc");
s1 = std::move(s3); s1 = std::move(s3);
s1 >> s; s1 >> s;
assert(s == L"Dddddddddddddddddd"); assert(s == L"Dddddddddddddddddd");
} }
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@ -14,33 +14,33 @@
template <typename Predicate, typename Arg> template <typename Predicate, typename Arg>
struct unary_counting_predicate : public std::unary_function<Arg, bool> { struct unary_counting_predicate : public std::unary_function<Arg, bool> {
public: public:
unary_counting_predicate(Predicate p) : p_(p), count_(0) {} unary_counting_predicate(Predicate p) : p_(p), count_(0) {}
~unary_counting_predicate() {} ~unary_counting_predicate() {}
bool operator () (const Arg &a) const { ++count_; return p_(a); } bool operator () (const Arg &a) const { ++count_; return p_(a); }
size_t count() const { return count_; } size_t count() const { return count_; }
void reset() { count_ = 0; } void reset() { count_ = 0; }
private: private:
Predicate p_; Predicate p_;
mutable size_t count_; mutable size_t count_;
}; };
template <typename Predicate, typename Arg1, typename Arg2=Arg1> template <typename Predicate, typename Arg1, typename Arg2=Arg1>
struct binary_counting_predicate : public std::binary_function<Arg1, Arg2, bool> { struct binary_counting_predicate : public std::binary_function<Arg1, Arg2, bool> {
public: public:
binary_counting_predicate ( Predicate p ) : p_(p), count_(0) {} binary_counting_predicate ( Predicate p ) : p_(p), count_(0) {}
~binary_counting_predicate() {} ~binary_counting_predicate() {}
bool operator () (const Arg1 &a1, const Arg2 &a2) const { ++count_; return p_(a1, a2); } bool operator () (const Arg1 &a1, const Arg2 &a2) const { ++count_; return p_(a1, a2); }
size_t count() const { return count_; } size_t count() const { return count_; }
void reset() { count_ = 0; } void reset() { count_ = 0; }
private: private:
Predicate p_; Predicate p_;
mutable size_t count_; mutable size_t count_;
}; };
#endif // __COUNTING_PREDICATES_H #endif // __COUNTING_PREDICATES_H

View File

@ -103,13 +103,13 @@ struct Foo { int x; };
int main() int main()
{ {
test_pointer<std::scoped_allocator_adaptor<std::allocator<char>>> (); test_pointer<std::scoped_allocator_adaptor<std::allocator<char>>> ();
test_pointer<std::scoped_allocator_adaptor<std::allocator<int>>> (); test_pointer<std::scoped_allocator_adaptor<std::allocator<int>>> ();
test_pointer<std::scoped_allocator_adaptor<std::allocator<Foo>>> (); test_pointer<std::scoped_allocator_adaptor<std::allocator<Foo>>> ();
test_void_pointer<std::scoped_allocator_adaptor<std::allocator<char>>> (); test_void_pointer<std::scoped_allocator_adaptor<std::allocator<char>>> ();
test_void_pointer<std::scoped_allocator_adaptor<std::allocator<int>>> (); test_void_pointer<std::scoped_allocator_adaptor<std::allocator<int>>> ();
test_void_pointer<std::scoped_allocator_adaptor<std::allocator<Foo>>> (); test_void_pointer<std::scoped_allocator_adaptor<std::allocator<Foo>>> ();
} }
#else #else
int main() {} int main() {}

View File

@ -35,9 +35,9 @@ int main()
unary_counting_predicate<bool(*)(int), int> cp(is5); unary_counting_predicate<bool(*)(int), int> cp(is5);
assert(!cp(6)); assert(!cp(6));
assert(cp.count() == 1); assert(cp.count() == 1);
assert(call_pred(cp)); assert(call_pred(cp));
assert(cp.count() == 1); assert(cp.count() == 1);
assert(call_pred(std::ref(cp))); assert(call_pred(std::ref(cp)));
assert(cp.count() == 2); assert(cp.count() == 2);
} }
} }

View File

@ -103,13 +103,13 @@ struct Foo { int x; };
int main() int main()
{ {
test_pointer<std::allocator<char>> (); test_pointer<std::allocator<char>> ();
test_pointer<std::allocator<int>> (); test_pointer<std::allocator<int>> ();
test_pointer<std::allocator<Foo>> (); test_pointer<std::allocator<Foo>> ();
test_void_pointer<std::allocator<char>> (); test_void_pointer<std::allocator<char>> ();
test_void_pointer<std::allocator<int>> (); test_void_pointer<std::allocator<int>> ();
test_void_pointer<std::allocator<Foo>> (); test_void_pointer<std::allocator<Foo>> ();
} }
#else #else
int main() {} int main() {}

View File

@ -39,7 +39,7 @@ int main()
test_alignment_of<int, 4>(); test_alignment_of<int, 4>();
test_alignment_of<double, 8>(); test_alignment_of<double, 8>();
#if (defined(__ppc__) && !defined(__ppc64__)) #if (defined(__ppc__) && !defined(__ppc64__))
test_alignment_of<bool, 4>(); // 32-bit PPC has four byte bool test_alignment_of<bool, 4>(); // 32-bit PPC has four byte bool
#else #else
test_alignment_of<bool, 1>(); test_alignment_of<bool, 1>();
#endif #endif

View File

@ -10,7 +10,7 @@
// type_traits // type_traits
// nullptr_t // nullptr_t
// is_null_pointer // is_null_pointer
#include <type_traits> #include <type_traits>

View File

@ -20,7 +20,7 @@
int main() int main()
{ {
#if _LIBCPP_STD_VER > 11 #if _LIBCPP_STD_VER > 11
using std::experimental::optional; using std::experimental::optional;
{ {
typedef int T; typedef int T;

View File

@ -18,9 +18,9 @@
int main() int main()
{ {
#if _LIBCPP_STD_VER > 11 #if _LIBCPP_STD_VER > 11
using std::experimental::optional; using std::experimental::optional;
using std::experimental::nullopt_t; using std::experimental::nullopt_t;
using std::experimental::nullopt; using std::experimental::nullopt;
{ {
typedef int T; typedef int T;

View File

@ -18,9 +18,9 @@
int main() int main()
{ {
#if _LIBCPP_STD_VER > 11 #if _LIBCPP_STD_VER > 11
using std::experimental::optional; using std::experimental::optional;
using std::experimental::nullopt_t; using std::experimental::nullopt_t;
using std::experimental::nullopt; using std::experimental::nullopt;
{ {
typedef int T; typedef int T;

View File

@ -16,7 +16,7 @@
int main() int main()
{ {
#if _LIBCPP_STD_VER > 11 #if _LIBCPP_STD_VER > 11
using std::experimental::optional; using std::experimental::optional;
optional<const void> opt; optional<const void> opt;
#else #else