boost_has_slist.ipp 944 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // (C) Copyright John Maddock 2001.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for most recent version.
  6. // MACRO: BOOST_HAS_SLIST
  7. // TITLE: <slist>
  8. // DESCRIPTION: The C++ implementation provides the (SGI) slist class.
  9. #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
  10. # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
  11. #include <ext/slist>
  12. #else
  13. #include <slist>
  14. #endif
  15. #ifndef BOOST_STD_EXTENSION_NAMESPACE
  16. #define BOOST_STD_EXTENSION_NAMESPACE std
  17. #endif
  18. namespace boost_has_slist{
  19. template <class T, class Alloc>
  20. void foo(const BOOST_STD_EXTENSION_NAMESPACE::slist<T,Alloc>& )
  21. {
  22. }
  23. int test()
  24. {
  25. BOOST_STD_EXTENSION_NAMESPACE::slist<int> l;
  26. foo(l);
  27. return 0;
  28. }
  29. }