1 /*============================================================================= 2 Copyright (c) 2004 Joel de Guzman 3 http://spirit.sourceforge.net/ 4 5 Use, modification and distribution is subject to the Boost Software 6 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 http://www.boost.org/LICENSE_1_0.txt) 8 =============================================================================*/ 9 #if !defined(SPIRIT_TEST_IMPL_STRING_LEN_HPP) 10 #define SPIRIT_TEST_IMPL_STRING_LEN_HPP 11 12 // We use our own string_len function instead of std::strlen 13 // to avoid the namespace confusion on different compilers. Some 14 // have it in namespace std. Some have it in global namespace. 15 // Some have it in both. 16 namespace test_impl 17 { 18 template <typename Char> 19 inline unsigned int string_length(Char const * str)20 string_length(Char const* str) 21 { 22 unsigned int len = 0; 23 while (*str++) 24 ++len; 25 return len; 26 } 27 } 28 29 #endif 30 31