diff options
author | Alec Thomas <alec@swapoff.org> | 2013-10-29 23:05:34 -0400 |
---|---|---|
committer | Alec Thomas <alec@swapoff.org> | 2013-10-29 23:05:34 -0400 |
commit | 9eddc27fcd35289f68be45caaa53a47b8041c12a (patch) | |
tree | 4e1d9f35a3beeddcf7df974252c59f6641bd0fe3 /cxx11 | |
parent | a9206abf2f7cf7d9de19d2e077a134485edf95db (diff) |
Normalize line endings
Diffstat (limited to 'cxx11')
-rw-r--r-- | cxx11/c++11-test-__func__-N2340.cpp | 16 | ||||
-rw-r--r-- | cxx11/c++11-test-auto-N2546.cpp | 24 | ||||
-rw-r--r-- | cxx11/c++11-test-constexpr-N2235.cpp | 38 | ||||
-rw-r--r-- | cxx11/c++11-test-cstdint.cpp | 20 | ||||
-rw-r--r-- | cxx11/c++11-test-decltype-N2343.cpp | 22 | ||||
-rw-r--r-- | cxx11/c++11-test-lambda-N2927.cpp | 10 | ||||
-rw-r--r-- | cxx11/c++11-test-long_long-N1811.cpp | 14 | ||||
-rw-r--r-- | cxx11/c++11-test-nullptr-N2431.cpp | 10 | ||||
-rw-r--r-- | cxx11/c++11-test-nullptr-N2431_fail_compile.cpp | 10 | ||||
-rw-r--r-- | cxx11/c++11-test-rvalue_references-N2118.cpp | 30 | ||||
-rw-r--r-- | cxx11/c++11-test-sizeof_member-N2253.cpp | 28 | ||||
-rw-r--r-- | cxx11/c++11-test-static_assert-N1720.cpp | 10 | ||||
-rw-r--r-- | cxx11/c++11-test-static_assert-N1720_fail_compile.cpp | 10 | ||||
-rw-r--r-- | cxx11/c++11-test-variadic_templates-N2555.cpp | 46 | ||||
-rw-r--r-- | cxx11/demo.cpp | 46 |
15 files changed, 167 insertions, 167 deletions
diff --git a/cxx11/c++11-test-__func__-N2340.cpp b/cxx11/c++11-test-__func__-N2340.cpp index c10dd18..d961df8 100644 --- a/cxx11/c++11-test-__func__-N2340.cpp +++ b/cxx11/c++11-test-__func__-N2340.cpp @@ -1,8 +1,8 @@ -#include <cstring>
-
-int main()
-{
- if (!__func__) { return 1; }
- if(std::strlen(__func__) <= 0) { return 1; }
- return 0;
-}
+#include <cstring> + +int main() +{ + if (!__func__) { return 1; } + if(std::strlen(__func__) <= 0) { return 1; } + return 0; +} diff --git a/cxx11/c++11-test-auto-N2546.cpp b/cxx11/c++11-test-auto-N2546.cpp index dbff414..948648e 100644 --- a/cxx11/c++11-test-auto-N2546.cpp +++ b/cxx11/c++11-test-auto-N2546.cpp @@ -1,12 +1,12 @@ -
-int main()
-{
- auto i = 5;
- auto f = 3.14159f;
- auto d = 3.14159;
- bool ret = (
- (sizeof(f) < sizeof(d)) &&
- (sizeof(i) == sizeof(int))
- );
- return ret ? 0 : 1;
-}
+ +int main() +{ + auto i = 5; + auto f = 3.14159f; + auto d = 3.14159; + bool ret = ( + (sizeof(f) < sizeof(d)) && + (sizeof(i) == sizeof(int)) + ); + return ret ? 0 : 1; +} diff --git a/cxx11/c++11-test-constexpr-N2235.cpp b/cxx11/c++11-test-constexpr-N2235.cpp index 9f969e4..ed62451 100644 --- a/cxx11/c++11-test-constexpr-N2235.cpp +++ b/cxx11/c++11-test-constexpr-N2235.cpp @@ -1,19 +1,19 @@ -constexpr int square(int x)
-{
- return x*x;
-}
-
-constexpr int the_answer()
-{
- return 42;
-}
-
-int main()
-{
- int test_arr[square(3)];
- bool ret = (
- (square(the_answer()) == 1764) &&
- (sizeof(test_arr)/sizeof(test_arr[0]) == 9)
- );
- return ret ? 0 : 1;
-}
+constexpr int square(int x) +{ + return x*x; +} + +constexpr int the_answer() +{ + return 42; +} + +int main() +{ + int test_arr[square(3)]; + bool ret = ( + (square(the_answer()) == 1764) && + (sizeof(test_arr)/sizeof(test_arr[0]) == 9) + ); + return ret ? 0 : 1; +} diff --git a/cxx11/c++11-test-cstdint.cpp b/cxx11/c++11-test-cstdint.cpp index 58d4381..be2878f 100644 --- a/cxx11/c++11-test-cstdint.cpp +++ b/cxx11/c++11-test-cstdint.cpp @@ -1,10 +1,10 @@ -#include <cstdint>
-int main()
-{
- bool test =
- (sizeof(int8_t) == 1) &&
- (sizeof(int16_t) == 2) &&
- (sizeof(int32_t) == 4) &&
- (sizeof(int64_t) == 8);
- return test ? 0 : 1;
-}
+#include <cstdint> +int main() +{ + bool test = + (sizeof(int8_t) == 1) && + (sizeof(int16_t) == 2) && + (sizeof(int32_t) == 4) && + (sizeof(int64_t) == 8); + return test ? 0 : 1; +} diff --git a/cxx11/c++11-test-decltype-N2343.cpp b/cxx11/c++11-test-decltype-N2343.cpp index d023885..843f83a 100644 --- a/cxx11/c++11-test-decltype-N2343.cpp +++ b/cxx11/c++11-test-decltype-N2343.cpp @@ -1,11 +1,11 @@ -
-bool check_size(int i)
-{
- return sizeof(int) == sizeof(decltype(i));
-}
-
-int main()
-{
- bool ret = check_size(42);
- return ret ? 0 : 1;
-}
+ +bool check_size(int i) +{ + return sizeof(int) == sizeof(decltype(i)); +} + +int main() +{ + bool ret = check_size(42); + return ret ? 0 : 1; +} diff --git a/cxx11/c++11-test-lambda-N2927.cpp b/cxx11/c++11-test-lambda-N2927.cpp index b86ad17..4c33ed5 100644 --- a/cxx11/c++11-test-lambda-N2927.cpp +++ b/cxx11/c++11-test-lambda-N2927.cpp @@ -1,5 +1,5 @@ -int main()
-{
- int ret = 0;
- return ([&ret]() -> int { return ret; })();
-}
+int main() +{ + int ret = 0; + return ([&ret]() -> int { return ret; })(); +} diff --git a/cxx11/c++11-test-long_long-N1811.cpp b/cxx11/c++11-test-long_long-N1811.cpp index 2ae6988..0911127 100644 --- a/cxx11/c++11-test-long_long-N1811.cpp +++ b/cxx11/c++11-test-long_long-N1811.cpp @@ -1,7 +1,7 @@ -int main(void)
-{
- long long l;
- unsigned long long ul;
-
- return ((sizeof(l) >= 8) && (sizeof(ul) >= 8)) ? 0 : 1;
-}
+int main(void) +{ + long long l; + unsigned long long ul; + + return ((sizeof(l) >= 8) && (sizeof(ul) >= 8)) ? 0 : 1; +} diff --git a/cxx11/c++11-test-nullptr-N2431.cpp b/cxx11/c++11-test-nullptr-N2431.cpp index 6c5ae66..c78fac4 100644 --- a/cxx11/c++11-test-nullptr-N2431.cpp +++ b/cxx11/c++11-test-nullptr-N2431.cpp @@ -1,5 +1,5 @@ -int main()
-{
- int* test = nullptr;
- return test ? 1 : 0;
-}
+int main() +{ + int* test = nullptr; + return test ? 1 : 0; +} diff --git a/cxx11/c++11-test-nullptr-N2431_fail_compile.cpp b/cxx11/c++11-test-nullptr-N2431_fail_compile.cpp index 5747f1b..7ab77a2 100644 --- a/cxx11/c++11-test-nullptr-N2431_fail_compile.cpp +++ b/cxx11/c++11-test-nullptr-N2431_fail_compile.cpp @@ -1,5 +1,5 @@ -int main()
-{
- int i = nullptr;
- return 1;
-}
+int main() +{ + int i = nullptr; + return 1; +} diff --git a/cxx11/c++11-test-rvalue_references-N2118.cpp b/cxx11/c++11-test-rvalue_references-N2118.cpp index ef4e421..75fb555 100644 --- a/cxx11/c++11-test-rvalue_references-N2118.cpp +++ b/cxx11/c++11-test-rvalue_references-N2118.cpp @@ -1,15 +1,15 @@ -int foo(int& lvalue)
-{
- return 123;
-}
-
-int foo(int&& rvalue)
-{
- return 321;
-}
-
-int main()
-{
- int i = 42;
- return ((foo(i) == 123) && (foo(42) == 321)) ? 0 : 1;
-}
+int foo(int& lvalue) +{ + return 123; +} + +int foo(int&& rvalue) +{ + return 321; +} + +int main() +{ + int i = 42; + return ((foo(i) == 123) && (foo(42) == 321)) ? 0 : 1; +} diff --git a/cxx11/c++11-test-sizeof_member-N2253.cpp b/cxx11/c++11-test-sizeof_member-N2253.cpp index 3049ed1..a55fc09 100644 --- a/cxx11/c++11-test-sizeof_member-N2253.cpp +++ b/cxx11/c++11-test-sizeof_member-N2253.cpp @@ -1,14 +1,14 @@ -struct foo {
- char bar;
- int baz;
-};
-
-int main(void)
-{
- bool ret = (
- (sizeof(foo::bar) == 1) &&
- (sizeof(foo::baz) >= sizeof(foo::bar)) &&
- (sizeof(foo) >= sizeof(foo::bar)+sizeof(foo::baz))
- );
- return ret ? 0 : 1;
-}
+struct foo { + char bar; + int baz; +}; + +int main(void) +{ + bool ret = ( + (sizeof(foo::bar) == 1) && + (sizeof(foo::baz) >= sizeof(foo::bar)) && + (sizeof(foo) >= sizeof(foo::bar)+sizeof(foo::baz)) + ); + return ret ? 0 : 1; +} diff --git a/cxx11/c++11-test-static_assert-N1720.cpp b/cxx11/c++11-test-static_assert-N1720.cpp index eae3c9a..c3d74ca 100644 --- a/cxx11/c++11-test-static_assert-N1720.cpp +++ b/cxx11/c++11-test-static_assert-N1720.cpp @@ -1,5 +1,5 @@ -int main()
-{
- static_assert(0 < 1, "your ordering of integers is screwed");
- return 0;
-}
+int main() +{ + static_assert(0 < 1, "your ordering of integers is screwed"); + return 0; +} diff --git a/cxx11/c++11-test-static_assert-N1720_fail_compile.cpp b/cxx11/c++11-test-static_assert-N1720_fail_compile.cpp index d97b679..4cb1183 100644 --- a/cxx11/c++11-test-static_assert-N1720_fail_compile.cpp +++ b/cxx11/c++11-test-static_assert-N1720_fail_compile.cpp @@ -1,5 +1,5 @@ -int main()
-{
- static_assert(1 < 0, "this should fail");
- return 0;
-}
+int main() +{ + static_assert(1 < 0, "this should fail"); + return 0; +} diff --git a/cxx11/c++11-test-variadic_templates-N2555.cpp b/cxx11/c++11-test-variadic_templates-N2555.cpp index 79fae84..4518e88 100644 --- a/cxx11/c++11-test-variadic_templates-N2555.cpp +++ b/cxx11/c++11-test-variadic_templates-N2555.cpp @@ -1,23 +1,23 @@ -int Accumulate()
-{
- return 0;
-}
-
-template<typename T, typename... Ts>
-int Accumulate(T v, Ts... vs)
-{
- return v + Accumulate(vs...);
-}
-
-template<int... Is>
-int CountElements()
-{
- return sizeof...(Is);
-}
-
-int main()
-{
- int acc = Accumulate(1, 2, 3, 4, -5);
- int count = CountElements<1,2,3,4,5>();
- return ((acc == 5) && (count == 5)) ? 0 : 1;
-}
+int Accumulate() +{ + return 0; +} + +template<typename T, typename... Ts> +int Accumulate(T v, Ts... vs) +{ + return v + Accumulate(vs...); +} + +template<int... Is> +int CountElements() +{ + return sizeof...(Is); +} + +int main() +{ + int acc = Accumulate(1, 2, 3, 4, -5); + int count = CountElements<1,2,3,4,5>(); + return ((acc == 5) && (count == 5)) ? 0 : 1; +} diff --git a/cxx11/demo.cpp b/cxx11/demo.cpp index 782681b..f647d15 100644 --- a/cxx11/demo.cpp +++ b/cxx11/demo.cpp @@ -1,23 +1,23 @@ -
-#include <iostream>
-
-int main()
-{
- std::cout << "Testing\n";
- std::cout << "Has static_assert: " <<
-#ifdef HAS_CXX11_STATIC_ASSERT
- "yes :)"
-#else
- "no"
-#endif
- << "\n";
- std::cout << "Has variadic templates: " <<
-#ifdef HAS_CXX11_VARIADIC_TEMPLATES
- "yes :)"
-#else
- "no"
-#endif
- << "\n";
- return 0;
-}
-
+ +#include <iostream> + +int main() +{ + std::cout << "Testing\n"; + std::cout << "Has static_assert: " << +#ifdef HAS_CXX11_STATIC_ASSERT + "yes :)" +#else + "no" +#endif + << "\n"; + std::cout << "Has variadic templates: " << +#ifdef HAS_CXX11_VARIADIC_TEMPLATES + "yes :)" +#else + "no" +#endif + << "\n"; + return 0; +} + |