Home | History | Annotate | Download | only in forwardlist
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <forward_list>
     11 
     12 // template <class T, class Allocator = allocator<T>>
     13 // class forward_list
     14 // {
     15 // public:
     16 //   typedef T         value_type;
     17 //   typedef Allocator allocator_type;
     18 //
     19 //   typedef value_type&                                                reference;
     20 //   typedef const value_type&                                          const_reference;
     21 //   typedef typename allocator_traits<allocator_type>::pointer         pointer;
     22 //   typedef typename allocator_traits<allocator_type>::const_pointer   const_pointer;
     23 //   typedef typename allocator_traits<allocator_type>::size_type       size_type;
     24 //   typedef typename allocator_traits<allocator_type>::difference_type difference_type;
     25 //   ...
     26 // };
     27 
     28 #include <forward_list>
     29 #include <type_traits>
     30 
     31 int main()
     32 {
     33     static_assert((std::is_same<std::forward_list<char>::value_type, char>::value), "");
     34     static_assert((std::is_same<std::forward_list<char>::allocator_type, std::allocator<char> >::value), "");
     35     static_assert((std::is_same<std::forward_list<char>::reference, char&>::value), "");
     36     static_assert((std::is_same<std::forward_list<char>::const_reference, const char&>::value), "");
     37     static_assert((std::is_same<std::forward_list<char>::pointer, char*>::value), "");
     38     static_assert((std::is_same<std::forward_list<char>::const_pointer, const char*>::value), "");
     39     static_assert((std::is_same<std::forward_list<char>::size_type, std::size_t>::value), "");
     40     static_assert((std::is_same<std::forward_list<char>::difference_type, std::ptrdiff_t>::value), "");
     41 }
     42