Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52853 - sandbox/ftmpl
From: whatwasthataddress_at_[hidden]
Date: 2009-05-08 11:05:11


Author: tzlaine
Date: 2009-05-08 11:05:10 EDT (Fri, 08 May 2009)
New Revision: 52853
URL: http://svn.boost.org/trac/boost/changeset/52853

Log:
Implemented vector push_front() and O(N) vector at().

Text files modified:
   sandbox/ftmpl/vector.hpp | 11 +++++++++++
   1 files changed, 11 insertions(+), 0 deletions(-)

Modified: sandbox/ftmpl/vector.hpp
==============================================================================
--- sandbox/ftmpl/vector.hpp (original)
+++ sandbox/ftmpl/vector.hpp 2009-05-08 11:05:10 EDT (Fri, 08 May 2009)
@@ -21,6 +21,9 @@
 template< typename ... T, typename Last >
 type_t< vector_t< T... > >& pop_back( type_t< vector_t< T..., Last > >& );
 
+template< typename ... T, typename Front >
+type_t< vector_t< Front, T...> >& push_front( type_t< vector_t< T... > >&, Front& );
+
 template< typename First, typename ... Tail >
 type_t< vector_t< Tail... > >& pop_front( type_t< vector_t< First, Tail... > >& );
 
@@ -30,6 +33,14 @@
 template< typename Head, typename ... T >
 Head& front( type_t< vector_t< Head, T... > >& );
 
+template< typename Head, typename ... T>
+auto at( type_t< vector_t< Head, T... > >&, type_t< value_t< std::size_t, 0u > >& )
+-> decltype( type< Head >() );
+
+template< typename Head, typename ... T, std::size_t I>
+auto at( type_t< vector_t< Head, T... > >&, type_t< value_t< std::size_t, I > >& )
+-> decltype( at( vector<T ...>(), value<std::size_t, I - 1>() ) );
+
 template< typename ... T >
 type_t< value_t< ::std::size_t, sizeof...( T ) > >& size( type_t< vector_t< T... > >& );
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk