Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/spirit/test/impl/string_length.hpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 951 bytes
Line 
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.
16namespace test_impl
17{
18    template <typename Char>
19    inline unsigned int
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
Note: See TracBrowser for help on using the repository browser.