diff --git a/include/boost/container/small_vector.hpp b/include/boost/container/small_vector.hpp index 6bc3d2f..75f7663 100644 --- a/include/boost/container/small_vector.hpp +++ b/include/boost/container/small_vector.hpp @@ -445,6 +445,7 @@ class small_vector : public small_vector_base typedef typename base_type::allocator_type allocator_type; typedef typename base_type::size_type size_type; + typedef typename base_type::value_type value_type; static std::size_t internal_capacity() { return (sizeof(small_vector) - storage_test::s_start)/sizeof(T); } @@ -485,6 +486,14 @@ class small_vector : public small_vector_base : base_type(initial_capacity_t(), internal_capacity(), a) { this->move_construct_impl(other, a); } + #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + small_vector(std::initializer_list il, const allocator_type& a = allocator_type()) + : base_type(initial_capacity_t(), internal_capacity(), a) + { + this->assign(il.begin(), il.end()); + } + #endif + small_vector& operator=(BOOST_COPY_ASSIGN_REF(small_vector) other) { return static_cast(this->base_type::operator=(static_cast(other))); } diff --git a/test/small_vector_test.cpp b/test/small_vector_test.cpp index cb3fb14..10a939e 100644 --- a/test/small_vector_test.cpp +++ b/test/small_vector_test.cpp @@ -167,9 +167,8 @@ int main() //////////////////////////////////// // Initializer lists testing //////////////////////////////////// - if(!boost::container::test::test_vector_methods_with_initializer_list_as_argument_for< - boost::container::vector - >()) { + if(!boost::container::test::test_vector_methods_with_initializer_list_as_argument_for + < boost::container::small_vector >()) { return 1; }