access_specifier.hpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Copyright 2003-2013 Joaquin M Lopez Munoz.
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * See http://www.boost.org/libs/multi_index for library home page.
  7. */
  8. #ifndef BOOST_MULTI_INDEX_DETAIL_ACCESS_SPECIFIER_HPP
  9. #define BOOST_MULTI_INDEX_DETAIL_ACCESS_SPECIFIER_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <boost/config.hpp>
  14. #include <boost/detail/workaround.hpp>
  15. /* In those compilers that do not accept the member template friend syntax,
  16. * some protected and private sections might need to be specified as
  17. * public.
  18. */
  19. #if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
  20. #define BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS public
  21. #define BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS public
  22. #else
  23. #define BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS protected
  24. #define BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS private
  25. #endif
  26. /* GCC does not correctly support in-class using declarations for template
  27. * functions. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9810
  28. * MSVC 7.1/8.0 seem to have a similar problem, though the conditions in
  29. * which the error happens are not that simple. I have yet to isolate this
  30. * into a snippet suitable for bug reporting.
  31. * Sun Studio also has this problem, which might be related, from the
  32. * information gathered at Sun forums, with a known issue notified at the
  33. * internal bug report 6421933. The bug is present up to Studio Express 2,
  34. * the latest preview version of the future Sun Studio 12. As of this writing
  35. * (October 2006) it is not known whether a fix will finally make it into the
  36. * official Sun Studio 12.
  37. */
  38. #if BOOST_WORKAROUND(__GNUC__,==3)&&(__GNUC_MINOR__<4)||\
  39. BOOST_WORKAROUND(BOOST_MSVC,==1310)||\
  40. BOOST_WORKAROUND(BOOST_MSVC,==1400)||\
  41. BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
  42. #define BOOST_MULTI_INDEX_PRIVATE_IF_USING_DECL_FOR_TEMPL_FUNCTIONS public
  43. #else
  44. #define BOOST_MULTI_INDEX_PRIVATE_IF_USING_DECL_FOR_TEMPL_FUNCTIONS private
  45. #endif
  46. #endif