Adding Constructor Template Auto Deduction guides.

This commit is contained in:
Richard Powell
2018-05-11 11:35:25 -06:00
parent b3eee90a81
commit 72195ae288
20 changed files with 455 additions and 0 deletions
+26
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;
}