case_conv.hpp

来自「CGAL is a collaborative effort of severa」· HPP 代码 · 共 61 行

HPP
61
字号
//  Boost string_algo library string_funct.hpp header file  ---------------------------////  Copyright Pavol Droba 2002-2003. Use, modification and//  distribution is subject to the Boost Software License, Version//  1.0. (See accompanying file LICENSE_1_0.txt or copy at//  http://www.boost.org/LICENSE_1_0.txt)//  See http://www.boost.org for updates, documentation, and revision history.#ifndef BOOST_STRING_CASE_CONV_DETAIL_HPP#define BOOST_STRING_CASE_CONV_DETAIL_HPP#include <boost/algorithm/string/config.hpp>#include <locale>#include <functional>namespace boost {    namespace algorithm {        namespace detail {//  case conversion functors -----------------------------------------------//            // a tolower functor             template<typename CharT>            struct to_lowerF : public std::unary_function<CharT, CharT>            {                // Constructor                to_lowerF( const std::locale& Loc ) : m_Loc( Loc ) {}                // Operation                CharT operator ()( CharT Ch ) const                {                    return std::tolower( Ch, m_Loc );                }            private:                const std::locale& m_Loc;            };            // a toupper functor             template<typename CharT>            struct to_upperF : public std::unary_function<CharT, CharT>            {                // Constructor                to_upperF( const std::locale& Loc ) : m_Loc( Loc ) {}                // Operation                CharT operator ()( CharT Ch ) const                {                    return std::toupper( Ch, m_Loc );                }            private:                const std::locale& m_Loc;            };        } // namespace detail    } // namespace algorithm} // namespace boost#endif  // BOOST_STRING_CASE_CONV_DETAIL_HPP

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?