boost_no_mem_templates.ipp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_NO_MEMBER_TEMPLATES
  7. // TITLE: member templates
  8. // DESCRIPTION: Member template functions not fully supported.
  9. #ifndef BOOST_NESTED_TEMPLATE
  10. #define BOOST_NESTED_TEMPLATE template
  11. #endif
  12. namespace boost_no_member_templates{
  13. template <class T>
  14. struct foo
  15. {
  16. template <class U>
  17. struct nested
  18. {
  19. typedef foo<U> other;
  20. };
  21. template <class U>
  22. void mfoo(const U&);
  23. };
  24. template <class T>
  25. template <class U>
  26. void foo<T>::mfoo(const U&)
  27. {
  28. }
  29. template <class T>
  30. void test_proc(T i)
  31. {
  32. foo<double> f1;
  33. typedef foo<T> ifoo;
  34. f1.mfoo(i);
  35. //f1.template mfoo<T>(i);
  36. typedef typename ifoo::BOOST_NESTED_TEMPLATE nested<double> bound_t;
  37. typedef typename bound_t::other other;
  38. other o;
  39. (void) &o;
  40. }
  41. int test()
  42. {
  43. test_proc(0);
  44. return 0;
  45. }
  46. }