_string_npos.h 1.0 KB

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2005
  3. * Francois Dumont
  4. *
  5. * This material is provided "as is", with absolutely no warranty expressed
  6. * or implied. Any use is at your own risk.
  7. *
  8. * Permission to use or copy this software for any purpose is hereby granted
  9. * without fee, provided the above notices are retained on all copies.
  10. * Permission to modify the code and to distribute modified code is granted,
  11. * provided the above notices are retained, and a notice that the code was
  12. * modified is included with the above copyright notice.
  13. */
  14. /* This header contains npos definition used in basic_string and rope
  15. * implementation. It do not have to be guarded as files including it
  16. * are already guarded and it has sometimes to be included several times.
  17. */
  18. #if defined (_STLP_STATIC_CONST_INIT_BUG)
  19. enum { npos = -1 };
  20. #elif defined (__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 96)
  21. // inline initializer conflicts with 'extern template'
  22. static const size_t npos;
  23. #else
  24. static const size_t npos = ~(size_t)0;
  25. #endif