lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
default_reallocation_policy.h
00001 /*****************************************************/
00002 /* lean Containers              (c) Tobias Zirr 2011 */
00003 /*****************************************************/
00004 
00005 #ifndef LEAN_CONTAINERS_DEFAULT_REALLOCATION_POLICY
00006 #define LEAN_CONTAINERS_DEFAULT_REALLOCATION_POLICY
00007 
00008 #include "../lean.h"
00009 
00010 namespace lean
00011 {
00012 namespace containers
00013 {
00014 
00016 
00017 template <class Container>
00018 class default_reallocation_policy
00019 {
00020 public:
00022     static LEAN_INLINE void reserve(Container &container, typename Container::size_type newCapacity)
00023     {
00024         container.reserve(newCapacity);
00025     }
00026 
00028     static LEAN_INLINE void pre_resize(Container &container, typename Container::size_type newCount)
00029     {
00030     }
00031 };
00032 
00033 } // namespace
00034 
00035 using containers::default_reallocation_policy;
00036 
00037 } // namespace
00038 
00039 #endif