Adding Constructor Template Auto Deduction guides.

This commit is contained in:
Richard Powell
2018-05-10 11:25:39 -06:00
parent b3eee90a81
commit 72195ae288
20 changed files with 455 additions and 0 deletions

View File

@@ -2238,6 +2238,13 @@ class deque : protected deque_base<Allocator>
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
deque(InputIterator, InputIterator) -> deque<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
deque(InputIterator, InputIterator, Allocator const&) -> deque<typename std::iterator_traits<InputIterator>::value_type, Allocator>;
#endif
}}
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED

View File

@@ -1449,6 +1449,25 @@ class flat_map
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
flat_map(InputIterator, InputIterator) -> flat_map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type>;
template <typename InputIterator, typename Allocator>
flat_map(InputIterator, InputIterator, Allocator const&) -> flat_map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, std::less<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>>, Allocator>;
template <typename InputIterator, typename Compare>
flat_map(InputIterator, InputIterator, Compare const&) -> flat_map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
flat_map(InputIterator, InputIterator, Compare const&, Allocator const&) -> flat_map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare, Allocator>;
template <typename InputIterator>
flat_map(ordered_unique_range_t, InputIterator, InputIterator) -> flat_map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type>;
template <typename InputIterator, typename Allocator>
flat_map(ordered_unique_range_t, InputIterator, InputIterator, Allocator const&) -> flat_map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, std::less<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>>, Allocator>;
template <typename InputIterator, typename Compare>
flat_map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&) -> flat_map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
flat_map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) -> flat_map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
} //namespace container {
@@ -2564,6 +2583,25 @@ class flat_multimap
{ x.swap(y); }
};
#if __cplusplus >= 201703L
template <typename InputIterator>
flat_multimap(InputIterator, InputIterator) -> flat_multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type>;
template <typename InputIterator, typename Allocator>
flat_multimap(InputIterator, InputIterator, Allocator const&) -> flat_multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, std::less<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>>, Allocator>;
template <typename InputIterator, typename Compare>
flat_multimap(InputIterator, InputIterator, Compare const&) -> flat_multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
flat_multimap(InputIterator, InputIterator, Compare const&, Allocator const&) -> flat_multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare, Allocator>;
template <typename InputIterator>
flat_multimap(ordered_range_t, InputIterator, InputIterator) -> flat_multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type>;
template <typename InputIterator, typename Allocator>
flat_multimap(ordered_range_t, InputIterator, InputIterator, Allocator const&) -> flat_multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, std::less<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>>, Allocator>;
template <typename InputIterator, typename Compare>
flat_multimap(ordered_range_t, InputIterator, InputIterator, Compare const&) -> flat_multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
flat_multimap(ordered_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) -> flat_multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare, Allocator>;
#endif
}}
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED

View File

@@ -1001,6 +1001,25 @@ class flat_set
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
flat_set(InputIterator, InputIterator) -> flat_set<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
flat_set(InputIterator, InputIterator, Allocator const&) -> flat_set<typename std::iterator_traits<InputIterator>::value_type, std::less<typename std::iterator_traits<InputIterator>::value_type>, Allocator>;
template <typename InputIterator, typename Compare>
flat_set(InputIterator, InputIterator, Compare const&) -> flat_set<typename std::iterator_traits<InputIterator>::value_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
flat_set(InputIterator, InputIterator, Compare const&, Allocator const&) -> flat_set<typename std::iterator_traits<InputIterator>::value_type, Compare, Allocator>;
template <typename InputIterator>
flat_set(ordered_unique_range_t, InputIterator, InputIterator) -> flat_set<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
flat_set(ordered_unique_range_t, InputIterator, InputIterator, Allocator const&) -> flat_set<typename std::iterator_traits<InputIterator>::value_type, std::less<typename std::iterator_traits<InputIterator>::value_type>, Allocator>;
template <typename InputIterator, typename Compare>
flat_set(ordered_unique_range_t, InputIterator, InputIterator, Compare const&) -> flat_set<typename std::iterator_traits<InputIterator>::value_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
flat_set(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) -> flat_set<typename std::iterator_traits<InputIterator>::value_type, Compare, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
} //namespace container {
@@ -1655,6 +1674,25 @@ class flat_multiset
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
flat_multiset(InputIterator, InputIterator) -> flat_multiset<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
flat_multiset(InputIterator, InputIterator, Allocator const&) -> flat_multiset<typename std::iterator_traits<InputIterator>::value_type, std::less<typename std::iterator_traits<InputIterator>::value_type>, Allocator>;
template <typename InputIterator, typename Compare>
flat_multiset(InputIterator, InputIterator, Compare const&) -> flat_multiset<typename std::iterator_traits<InputIterator>::value_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
flat_multiset(InputIterator, InputIterator, Compare const&, Allocator const&) -> flat_multiset<typename std::iterator_traits<InputIterator>::value_type, Compare, Allocator>;
template <typename InputIterator>
flat_multiset(ordered_range_t, InputIterator, InputIterator) -> flat_multiset<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
flat_multiset(ordered_range_t, InputIterator, InputIterator, Allocator const&) -> flat_multiset<typename std::iterator_traits<InputIterator>::value_type, std::less<typename std::iterator_traits<InputIterator>::value_type>, Allocator>;
template <typename InputIterator, typename Compare>
flat_multiset(ordered_range_t, InputIterator, InputIterator, Compare const&) -> flat_multiset<typename std::iterator_traits<InputIterator>::value_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
flat_multiset(ordered_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) -> flat_multiset<typename std::iterator_traits<InputIterator>::value_type, Compare, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
} //namespace container {

View File

@@ -1464,6 +1464,13 @@ class list
};
#if __cplusplus >= 201703L
template <typename InputIterator>
list(InputIterator, InputIterator) -> list<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
list(InputIterator, InputIterator, Allocator const&) -> list<typename std::iterator_traits<InputIterator>::value_type, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
} //namespace container {

View File

@@ -1175,6 +1175,25 @@ class map
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
map(InputIterator, InputIterator) -> map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type>;
template <typename InputIterator, typename Allocator>
map(InputIterator, InputIterator, Allocator const&) -> map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, std::less<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>>, Allocator>;
template <typename InputIterator, typename Compare>
map(InputIterator, InputIterator, Compare const&) -> map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
map(InputIterator, InputIterator, Compare const&, Allocator const&) -> map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare, Allocator>;
template <typename InputIterator>
map(ordered_unique_range_t, InputIterator, InputIterator) -> map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type>;
template <typename InputIterator, typename Allocator>
map(ordered_unique_range_t, InputIterator, InputIterator, Allocator const&) -> map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, std::less<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>>, Allocator>;
template <typename InputIterator, typename Compare>
map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&) -> map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) -> map<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -1923,6 +1942,25 @@ class multimap
#endif //#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
};
#if __cplusplus >= 201703L
template <typename InputIterator>
multimap(InputIterator, InputIterator) -> multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type>;
template <typename InputIterator, typename Allocator>
multimap(InputIterator, InputIterator, Allocator const&) -> multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, std::less<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>>, Allocator>;
template <typename InputIterator, typename Compare>
multimap(InputIterator, InputIterator, Compare const&) -> multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
multimap(InputIterator, InputIterator, Compare const&, Allocator const&) -> multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare, Allocator>;
template <typename InputIterator>
multimap(ordered_range_t, InputIterator, InputIterator) -> multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type>;
template <typename InputIterator, typename Allocator>
multimap(ordered_range_t, InputIterator, InputIterator, Allocator const&) -> multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, std::less<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>>, Allocator>;
template <typename InputIterator, typename Compare>
multimap(ordered_range_t, InputIterator, InputIterator, Compare const&) -> multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
multimap(ordered_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) -> multimap<std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type::first_type>, typename std::iterator_traits<InputIterator>::value_type::second_type, Compare, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
} //namespace container {

View File

@@ -854,6 +854,25 @@ class set
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
set(InputIterator, InputIterator) -> set<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
set(InputIterator, InputIterator, Allocator const&) -> set<typename std::iterator_traits<InputIterator>::value_type, std::less<typename std::iterator_traits<InputIterator>::value_type>, Allocator>;
template <typename InputIterator, typename Compare>
set(InputIterator, InputIterator, Compare const&) -> set<typename std::iterator_traits<InputIterator>::value_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
set(InputIterator, InputIterator, Compare const&, Allocator const&) -> set<typename std::iterator_traits<InputIterator>::value_type, Compare, Allocator>;
template <typename InputIterator>
set(ordered_unique_range_t, InputIterator, InputIterator) -> set<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
set(ordered_unique_range_t, InputIterator, InputIterator, Allocator const&) -> set<typename std::iterator_traits<InputIterator>::value_type, std::less<typename std::iterator_traits<InputIterator>::value_type>, Allocator>;
template <typename InputIterator, typename Compare>
set(ordered_unique_range_t, InputIterator, InputIterator, Compare const&) -> set<typename std::iterator_traits<InputIterator>::value_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
set(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) -> set<typename std::iterator_traits<InputIterator>::value_type, Compare, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
} //namespace container {
@@ -1404,6 +1423,25 @@ class multiset
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
multiset(InputIterator, InputIterator) -> multiset<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
multiset(InputIterator, InputIterator, Allocator const&) -> multiset<typename std::iterator_traits<InputIterator>::value_type, std::less<typename std::iterator_traits<InputIterator>::value_type>, Allocator>;
template <typename InputIterator, typename Compare>
multiset(InputIterator, InputIterator, Compare const&) -> multiset<typename std::iterator_traits<InputIterator>::value_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
multiset(InputIterator, InputIterator, Compare const&, Allocator const&) -> multiset<typename std::iterator_traits<InputIterator>::value_type, Compare, Allocator>;
template <typename InputIterator>
multiset(ordered_range_t, InputIterator, InputIterator) -> multiset<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
multiset(ordered_range_t, InputIterator, InputIterator, Allocator const&) -> multiset<typename std::iterator_traits<InputIterator>::value_type, std::less<typename std::iterator_traits<InputIterator>::value_type>, Allocator>;
template <typename InputIterator, typename Compare>
multiset(ordered_range_t, InputIterator, InputIterator, Compare const&) -> multiset<typename std::iterator_traits<InputIterator>::value_type, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
multiset(ordered_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) -> multiset<typename std::iterator_traits<InputIterator>::value_type, Compare, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
} //namespace container {

View File

@@ -1632,6 +1632,13 @@ class slist
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InpIt>
slist(InpIt, InpIt) -> slist<typename std::iterator_traits<InpIt>::value_type>;
template <typename InpIt, typename Allocator>
slist(InpIt, InpIt, Allocator const&) -> slist<typename std::iterator_traits<InpIt>::value_type, Allocator>;
#endif
}}
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED

View File

@@ -2085,6 +2085,13 @@ class stable_vector
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
stable_vector(InputIterator, InputIterator) -> stable_vector<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
stable_vector(InputIterator, InputIterator, Allocator const&) -> stable_vector<typename std::iterator_traits<InputIterator>::value_type, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
#undef STABLE_VECTOR_CHECK_INVARIANT

View File

@@ -2933,6 +2933,13 @@ class basic_string
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
basic_string(InputIterator, InputIterator) -> basic_string<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
basic_string(InputIterator, InputIterator, Allocator const&) -> basic_string<typename std::iterator_traits<InputIterator>::value_type, Allocator>;
#endif
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
//!Typedef for a basic_string of

View File

@@ -931,6 +931,12 @@ class vector
//! throws or T's constructor taking a dereferenced InIt throws.
//!
//! <b>Complexity</b>: Linear to the range [first, last).
// template <class InIt>
// vector(InIt first, InIt last
// BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c
// < dtl::is_convertible<InIt BOOST_MOVE_I size_type>::value
// BOOST_MOVE_I dtl::nat >::type * = 0)
// ) -> vector<typename iterator_traits<InIt>::value_type, new_allocator<typename iterator_traits<InIt>::value_type>>;
template <class InIt>
vector(InIt first, InIt last
BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c
@@ -947,6 +953,12 @@ class vector
//! throws or T's constructor taking a dereferenced InIt throws.
//!
//! <b>Complexity</b>: Linear to the range [first, last).
// template <class InIt>
// vector(InIt first, InIt last, const allocator_type& a
// BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c
// < dtl::is_convertible<InIt BOOST_MOVE_I size_type>::value
// BOOST_MOVE_I dtl::nat >::type * = 0)
// ) -> vector<typename iterator_traits<InIt>::value_type, new_allocator<typename iterator_traits<InIt>::value_type>>;
template <class InIt>
vector(InIt first, InIt last, const allocator_type& a
BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c
@@ -3352,6 +3364,14 @@ class vector
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
template <typename InputIterator>
vector(InputIterator, InputIterator) -> vector<typename std::iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>
vector(InputIterator, InputIterator, Allocator const&) -> vector<typename std::iterator_traits<InputIterator>::value_type, Allocator>;
#endif
}} //namespace boost::container
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED

View File

@@ -282,6 +282,20 @@ bool do_test()
if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
}
#if __cplusplus >= 201703L
//Check Constructor Template Auto Deduction
{
auto gold = MyStdDeque{ 1, 2, 3 };
auto test = deque(gold.begin(), gold.end());
if(!test::CheckEqualContainers(gold, test)) return false;
}
{
auto gold = MyStdDeque{ 1, 2, 3 };
auto test = deque(gold.begin(), gold.end(), new_allocator<int>());
if(!test::CheckEqualContainers(gold, test)) return false;
}
#endif
std::cout << std::endl << "Test OK!" << std::endl;
return true;
}

View File

@@ -248,6 +248,36 @@ bool flat_tree_ordered_insertion_test()
return true;
}
bool constructor_template_auto_deduction_test()
{
#if __cplusplus >= 201703L
using namespace boost::container;
const std::size_t NumElements = 100;
//Ordered insertion map
{
std::map<int, int> int_map;
for(std::size_t i = 0; i != NumElements; ++i){
int_map.insert(std::map<int, int>::value_type(static_cast<int>(i), static_cast<int>(i)));
}
//Construction insertion
auto fmap = flat_map(ordered_unique_range, int_map.begin(), int_map.end());
if(!CheckEqualContainers(int_map, fmap))
return false;
std::multimap<int, int> int_mmap;
for(std::size_t i = 0; i != NumElements; ++i){
int_mmap.insert(std::multimap<int, int>::value_type(static_cast<int>(i), static_cast<int>(i)));
}
//Construction insertion
auto fmmap = flat_multimap(ordered_range, int_mmap.begin(), int_mmap.end());
if(!CheckEqualContainers(int_mmap, fmmap))
return false;
}
#endif
return true;
}
template< class RandomIt >
void random_shuffle( RandomIt first, RandomIt last )
{
@@ -517,6 +547,13 @@ int main()
return 1;
}
////////////////////////////////////
// Constructor Template Auto Deduction test
////////////////////////////////////
if(!constructor_template_auto_deduction_test()){
return 1;
}
////////////////////////////////////
// Extract/Adopt test
////////////////////////////////////

View File

@@ -695,6 +695,30 @@ int main()
}
}
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction
////////////////////////////////////
{
auto gold = std::set({ 1, 2, 3 });
auto test = boost::container::flat_set(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
test = boost::container::flat_set(ordered_unique_range, gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
{
auto gold = std::multiset({ 1, 2, 3 });
auto test = boost::container::flat_multiset(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
test = boost::container::flat_multiset(ordered_range, gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
#endif
return 0;
}

View File

@@ -211,6 +211,44 @@ int main ()
}
}
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction Tests
////////////////////////////////////
{
auto gold = std::list{ 1, 2, 3 };
auto test = boost::container::list(gold.begin(), gold.end());
if (test.size() != 3) {
return 1;
}
if (test.front() != 1)
return 1;
test.pop_front();
if (test.front() != 2)
return 1;
test.pop_front();
if (test.front() != 3)
return 1;
test.pop_front();
}
{
auto gold = std::list{ 1, 2, 3 };
auto test = boost::container::list(gold.begin(), gold.end(), new_allocator<int>());
if (test.size() != 3) {
return 1;
}
if (test.front() != 1)
return 1;
test.pop_front();
if (test.front() != 2)
return 1;
test.pop_front();
if (test.front() != 3)
return 1;
test.pop_front();
}
#endif
return 0;
}

View File

@@ -426,6 +426,24 @@ int main ()
}
}
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction
////////////////////////////////////
{
auto gold = std::map<int, int>({ {1,1}, {2,2}, {3,3} } );
auto test = boost::container::map(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
{
auto gold = std::multimap<int, int>({ {1,1}, {2,2}, {3,3} } );
auto test = boost::container::multimap(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
#endif
////////////////////////////////////
// Node extraction/insertion testing functions
////////////////////////////////////

View File

@@ -455,6 +455,30 @@ int main ()
if(!node_type_test())
return 1;
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction
////////////////////////////////////
{
auto gold = std::set({ 1, 2, 3 });
auto test = boost::container::set(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
test = boost::container::set(ordered_unique_range, gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
{
auto gold = std::multiset({ 1, 2, 3 });
auto test = boost::container::multiset(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
test = boost::container::multiset(ordered_range, gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
#endif
return 0;
}

View File

@@ -251,6 +251,45 @@ int main ()
return 1;
}
}
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction Tests
////////////////////////////////////
{
auto gold = std::list{ 1, 2, 3 };
auto test = boost::container::slist(gold.begin(), gold.end());
if (test.size() != 3) {
return 1;
}
if (test.front() != 1)
return 1;
test.pop_front();
if (test.front() != 2)
return 1;
test.pop_front();
if (test.front() != 3)
return 1;
test.pop_front();
}
{
auto gold = std::list{ 1, 2, 3 };
auto test = boost::container::slist(gold.begin(), gold.end(), new_allocator<int>());
if (test.size() != 3) {
return 1;
}
if (test.front() != 1)
return 1;
test.pop_front();
if (test.front() != 2)
return 1;
test.pop_front();
if (test.front() != 3)
return 1;
test.pop_front();
}
#endif
return 0;
}
#include <boost/container/detail/config_end.hpp>

View File

@@ -193,6 +193,22 @@ int main()
}
}
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction testing
////////////////////////////////////
{
auto gold = std::vector{ 1, 2, 3 };
auto test = boost::container::stable_vector(gold.begin(), gold.end());
if (test.size() != 3) {
return 1;
}
if (!(test[0] == 1 && test[1] == 2 && test[2] == 3)) {
return 1;
}
}
#endif
return 0;
}

View File

@@ -478,6 +478,18 @@ int string_test()
return 1;
}
#if __cplusplus >= 201703L
//Chect Constructor Template Auto Deduction
{
auto gold = StdString(string_literals<CharType>::String());
auto test = basic_string(gold.begin(), gold.end());
if(!StringEqual()(gold, test)) {
return 1;
}
}
#endif
//When done, delete vector
delete boostStringVect;
delete stdStringVect;

View File

@@ -250,5 +250,31 @@ int main()
return 1;
}
}
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction testing
////////////////////////////////////
{
auto gold = std::vector{ 1, 2, 3 };
auto test = boost::container::vector(gold.begin(), gold.end());
if (test.size() != 3) {
return 1;
}
if (!(test[0] == 1 && test[1] == 2 && test[2] == 3)) {
return 1;
}
}
{
auto gold = std::vector{ 1, 2, 3 };
auto test = boost::container::vector(gold.begin(), gold.end(), boost::container::new_allocator<int>());
if (test.size() != 3) {
return 1;
}
if (!(test[0] == 1 && test[1] == 2 && test[2] == 3)) {
return 1;
}
}
#endif
return 0;
}