mirror of
https://github.com/boostorg/detail.git
synced 2025-07-31 12:57:14 +02:00
Remove typename/template uses outside of templates
This commit is contained in:
@ -8,9 +8,9 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
typedef std::allocator<int> std_int_allocator;
|
typedef std::allocator<int> std_int_allocator;
|
||||||
typedef typename boost::detail::allocator::rebind_to<std_int_allocator, char>::type char_allocator;
|
typedef boost::detail::allocator::rebind_to<std_int_allocator, char>::type char_allocator;
|
||||||
typedef typename boost::detail::allocator::rebind_to<char_allocator, int>::type int_allocator;
|
typedef boost::detail::allocator::rebind_to<char_allocator, int>::type int_allocator;
|
||||||
typedef typename boost::detail::allocator::rebind_to<int_allocator, char>::type char_allocator2;
|
typedef boost::detail::allocator::rebind_to<int_allocator, char>::type char_allocator2;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
BOOST_STATIC_ASSERT((!boost::is_same<char_allocator, int_allocator>::value));
|
BOOST_STATIC_ASSERT((!boost::is_same<char_allocator, int_allocator>::value));
|
||||||
@ -24,14 +24,14 @@ int main() {
|
|||||||
|
|
||||||
// Check allocate works okay
|
// Check allocate works okay
|
||||||
{
|
{
|
||||||
typename char_allocator::pointer p = a2.allocate(10);
|
char_allocator::pointer p = a2.allocate(10);
|
||||||
assert(p);
|
assert(p);
|
||||||
a2.deallocate(p, 10);
|
a2.deallocate(p, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try using the standalone construct/destroy
|
// Try using the standalone construct/destroy
|
||||||
{
|
{
|
||||||
typename int_allocator::pointer p2 = a3.allocate(1);
|
int_allocator::pointer p2 = a3.allocate(1);
|
||||||
boost::detail::allocator::construct(p2, 25);
|
boost::detail::allocator::construct(p2, 25);
|
||||||
assert(*p2 == 25);
|
assert(*p2 == 25);
|
||||||
boost::detail::allocator::destroy(p2);
|
boost::detail::allocator::destroy(p2);
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<int, boost::detail::make_reference_content<int>::type>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<int, boost::detail::make_reference_content<int>::type>::value));
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<boost::detail::reference_content<int&>, boost::detail::make_reference_content<int&>::type>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<boost::detail::reference_content<int&>, boost::detail::make_reference_content<int&>::type>::value));
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<int, boost::detail::make_reference_content<>::template apply<int>::type>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<int, boost::detail::make_reference_content<>::apply<int>::type>::value));
|
||||||
BOOST_STATIC_ASSERT((boost::is_same<boost::detail::reference_content<int&>, boost::detail::make_reference_content<>::template apply<int&>::type>::value));
|
BOOST_STATIC_ASSERT((boost::is_same<boost::detail::reference_content<int&>, boost::detail::make_reference_content<>::apply<int&>::type>::value));
|
||||||
BOOST_STATIC_ASSERT((boost::has_nothrow_copy<boost::detail::make_reference_content<int&>::type>::value));
|
BOOST_STATIC_ASSERT((boost::has_nothrow_copy<boost::detail::make_reference_content<int&>::type>::value));
|
||||||
|
|
||||||
int main() {}
|
int main() {}
|
||||||
|
Reference in New Issue
Block a user