mirror of
https://github.com/boostorg/detail.git
synced 2025-07-29 20:07:15 +02:00
Quickbook: Copy trunk libs into quickbook-dev branch.
[SVN r75213]
This commit is contained in:
@ -5,6 +5,8 @@
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
################################################################################
|
||||
|
||||
build-project container_fwd ;
|
||||
|
||||
project detail/test
|
||||
: requirements
|
||||
<toolset>clang:<cxxflags>-Wno-unused
|
||||
|
28
test/container_fwd/Jamfile
Normal file
28
test/container_fwd/Jamfile
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
# Copyright 2011 Daniel James.
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import testing ;
|
||||
|
||||
project detail/test/container_fwd
|
||||
: requirements
|
||||
<warnings>all
|
||||
<toolset>intel:<warnings>on
|
||||
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||
<warnings-as-errors>on
|
||||
;
|
||||
|
||||
run container_no_fwd_test.cpp ;
|
||||
run container_fwd_test.cpp : : : : container_fwd ;
|
||||
run container_fwd_test.cpp : :
|
||||
: <define>_STLP_DEBUG <define>_GLIBCXX_DEBUG
|
||||
: container_fwd_debug ;
|
||||
|
||||
compile-fail correctly_disable_fail.cpp
|
||||
: <warnings-as-errors>off
|
||||
: correctly_disable ;
|
||||
compile-fail correctly_disable_fail.cpp
|
||||
: <warnings-as-errors>off <define>_STLP_DEBUG <define>_GLIBCXX_DEBUG
|
||||
: correctly_disable_debug ;
|
112
test/container_fwd/container_fwd_test.cpp
Normal file
112
test/container_fwd/container_fwd_test.cpp
Normal file
@ -0,0 +1,112 @@
|
||||
|
||||
// Copyright 2005-2009 Daniel James.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/functional/detail/container_fwd.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__GNUC__, < 3) && \
|
||||
!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
||||
template <class charT, class Allocator>
|
||||
static void test(
|
||||
std::basic_string<charT, std::string_char_traits<charT>, Allocator> const&)
|
||||
{
|
||||
}
|
||||
#else
|
||||
template <class charT, class Allocator>
|
||||
static void test(
|
||||
std::basic_string<charT, std::char_traits<charT>, Allocator> const&)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T, class Allocator>
|
||||
static void test(std::deque<T, Allocator> const&)
|
||||
{
|
||||
}
|
||||
|
||||
template <class T, class Allocator>
|
||||
static void test(std::list<T, Allocator> const&)
|
||||
{
|
||||
}
|
||||
|
||||
template <class T, class Allocator>
|
||||
static void test(std::vector<T, Allocator> const&)
|
||||
{
|
||||
}
|
||||
|
||||
template <class Key, class T, class Compare, class Allocator>
|
||||
static void test(std::map<Key, T, Compare, Allocator> const&)
|
||||
{
|
||||
}
|
||||
|
||||
template <class Key, class T, class Compare, class Allocator>
|
||||
static void test(std::multimap<Key, T, Compare, Allocator> const&)
|
||||
{
|
||||
}
|
||||
|
||||
template <class Key, class Compare, class Allocator>
|
||||
static void test(std::set<Key, Compare, Allocator> const&)
|
||||
{
|
||||
}
|
||||
|
||||
template <class Key, class Compare, class Allocator>
|
||||
static void test(std::multiset<Key, Compare, Allocator> const&)
|
||||
{
|
||||
}
|
||||
|
||||
template <std::size_t N>
|
||||
static void test(std::bitset<N> const&)
|
||||
{
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static void test(std::complex<T> const&)
|
||||
{
|
||||
}
|
||||
|
||||
template <class X, class Y>
|
||||
static void test(std::pair<X, Y> const&)
|
||||
{
|
||||
}
|
||||
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <bitset>
|
||||
#include <string>
|
||||
#include <complex>
|
||||
#include <utility>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::deque<int> x1;
|
||||
std::list<std::string> x2;
|
||||
std::vector<float> x3;
|
||||
std::vector<bool> x4;
|
||||
std::map<int, int> x5;
|
||||
std::multimap<float, int*> x6;
|
||||
std::set<std::string> x7;
|
||||
std::multiset<std::vector<int> > x8;
|
||||
std::bitset<10> x9;
|
||||
std::string x10;
|
||||
std::complex<double> x11;
|
||||
std::pair<std::list<int>, char***> x12;
|
||||
|
||||
test(x1);
|
||||
test(x2);
|
||||
test(x3);
|
||||
test(x4);
|
||||
test(x5);
|
||||
test(x6);
|
||||
test(x7);
|
||||
test(x8);
|
||||
test(x9);
|
||||
test(x10);
|
||||
test(x11);
|
||||
test(x12);
|
||||
|
||||
return 0;
|
||||
}
|
14
test/container_fwd/container_no_fwd_test.cpp
Normal file
14
test/container_fwd/container_no_fwd_test.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
// Copyright 2010 Daniel James.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
|
||||
#include <boost/detail/container_fwd.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::set<int> x;
|
||||
std::vector<std::string> y;
|
||||
}
|
43
test/container_fwd/correctly_disable_fail.cpp
Normal file
43
test/container_fwd/correctly_disable_fail.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
// Copyright 2011 Daniel James.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// This tests if container forwarding is correctly disabled. If it isn't
|
||||
// disabled it causes a compile error (which causes the test to pass).
|
||||
// If it is disabled it tries container forwarding. If it doesn't work
|
||||
// then there will be a compile error, indicating that it is correctly
|
||||
// disabled. But if there isn't a compile error that indicates that
|
||||
// container forwarding might work.
|
||||
//
|
||||
// Since this test only tries std::vector, it might get it wrong but I didn't
|
||||
// want it to fail because of some incompatibility with a trickier class.
|
||||
|
||||
#define BOOST_DETAIL_TEST_CONFIG_ONLY
|
||||
#include <boost/detail/container_fwd.hpp>
|
||||
|
||||
#if !defined(BOOST_DETAIL_NO_CONTAINER_FWD)
|
||||
#error "Failing in order to pass test"
|
||||
#else
|
||||
#define BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD
|
||||
|
||||
#undef BOOST_DETAIL_CONTAINER_FWD_HPP
|
||||
#undef BOOST_DETAIL_TEST_CONFIG_ONLY
|
||||
|
||||
#include <boost/detail/container_fwd.hpp>
|
||||
|
||||
template <class T, class Allocator>
|
||||
void test(std::vector<T, Allocator> const&)
|
||||
{
|
||||
}
|
||||
|
||||
#include <vector>
|
||||
|
||||
int main ()
|
||||
{
|
||||
std::vector<int> x;
|
||||
test(x);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user