00001 #ifndef STATIC_CONTAINER_LIST_H 00002 00003 #define STATIC_CONTAINER_LIST_H 00004 00005 #include "static_container/lodge_list.h" 00006 #include <boost/utility.hpp> 00007 00008 namespace static_container { 00009 00011 00017 template < typename Value, size_type MaxSize > 00018 class list : 00019 private boost::base_from_member< list_node_pool< Value, MaxSize > >, 00020 public lodge_list< Value >, 00021 public compare_methods< list< Value, MaxSize > > { 00022 00023 typedef boost::base_from_member< list_node_pool< Value, MaxSize > > pool; 00024 typedef lodge_list< Value > parent; 00025 public: 00026 list() : parent( pool::member ) {} 00027 00028 list( const list& other ) : parent( pool::member ) { 00029 insert( begin(), other.begin(), other.end() ); 00030 } 00031 list& operator = ( const list& other ) { 00032 if ( this != &other ) { 00033 clear(); 00034 insert( begin(), other.begin(), other.end() ); 00035 } 00036 return *this; 00037 } 00038 00040 bool full() const { 00041 return pool::member.full(); 00042 } 00043 00045 static size_type max_size() { 00046 return MaxSize; 00047 } 00048 }; 00049 } 00050 00051 #endif