From 94b2dd0998230c758abd92c99d3700c971f7a31a Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sun, 22 Aug 2010 00:59:46 +0000 Subject: Fixing whitespace problems llvm-svn: 111767 --- .../pointer.traits.functions/pointer_to.pass.cpp | 49 +++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp') diff --git a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp index 8ed66297f31..10cdb897002 100644 --- a/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp +++ b/libcxx/test/utilities/memory/pointer.traits/pointer.traits.functions/pointer_to.pass.cpp @@ -1 +1,48 @@ -//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // static pointer pointer_to(
); // ... // }; #include #include template struct A { private: struct nat {}; public: typedef T element_type; element_type* t_; A(element_type* t) : t_(t) {} static A pointer_to(typename std::conditional::value, nat, element_type>::type& et) {return A(&et);} }; int main() { { int i = 0; A a = std::pointer_traits >::pointer_to(i); assert(a.t_ = &i); } { (std::pointer_traits >::element_type)0; } } \ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// struct pointer_traits +// { +// static pointer pointer_to(
); +// ... +// }; + +#include +#include + +template +struct A +{ +private: + struct nat {}; +public: + typedef T element_type; + element_type* t_; + + A(element_type* t) : t_(t) {} + + static A pointer_to(typename std::conditional::value, + nat, element_type>::type& et) + {return A(&et);} +}; + +int main() +{ + { + int i = 0; + A a = std::pointer_traits >::pointer_to(i); + assert(a.t_ = &i); + } + { + (std::pointer_traits >::element_type)0; + } +} -- cgit v1.2.3