]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/container/test/explicit_inst_vector_test.cpp
1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/container for documentation.
9 //////////////////////////////////////////////////////////////////////////////
11 #include <boost/container/vector.hpp>
15 friend bool operator == (const empty
&, const empty
&){ return true; }
16 friend bool operator < (const empty
&, const empty
&){ return true; }
19 template class ::boost::container::vector
<empty
>;
20 volatile ::boost::container::vector
<empty
> dummy
;
22 #include <boost/container/allocator.hpp>
23 #include "movable_int.hpp"
24 #include "dummy_test_allocator.hpp"
29 typedef int value_type
;
30 typedef value_type
* pointer
;
31 typedef const value_type
* const_pointer
;
32 typedef unsigned short size_type
;
33 typedef short difference_type
;
35 pointer
allocate(size_type count
)
36 { return (pointer
)new char[sizeof(value_type
)*count
]; }
38 void deallocate(pointer ptr
, size_type
)
39 { delete [](char*)ptr
; }
41 friend bool operator==(CustomAllocator
const&, CustomAllocator
const&) BOOST_NOEXCEPT
44 friend bool operator!=(CustomAllocator
const& x
, CustomAllocator
const& y
) BOOST_NOEXCEPT
52 //Explicit instantiation to detect compilation errors
53 template class boost::container::vector
54 < test::movable_and_copyable_int
55 , test::simple_allocator
<test::movable_and_copyable_int
> >;
57 template class boost::container::vector
58 < test::movable_and_copyable_int
59 , allocator
<test::movable_and_copyable_int
> >;
61 template class vec_iterator
<int*, true >;
62 template class vec_iterator
<int*, false>;
64 //Test stored_size option
65 template class boost::container::vector
< test::movable_and_copyable_int
66 , new_allocator
<test::movable_and_copyable_int
>
67 , vector_options
< stored_size
<unsigned short> >::type
70 //test custom allocator with small size_type
71 template class boost::container::vector
<int, CustomAllocator
>;
74 } //namespace container {