forked from boostorg/regex
merged changes in regex5 branch
[SVN r26692]
This commit is contained in:
65
include/boost/regex/v4/protected_call.hpp
Normal file
65
include/boost/regex/v4/protected_call.hpp
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2004
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Use, modification and distribution are 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)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE basic_regex_creator.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares template class basic_regex_creator which fills in
|
||||
* the data members of a regex_data object.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_REGEX_V4_PROTECTED_CALL_HPP
|
||||
#define BOOST_REGEX_V4_PROTECTED_CALL_HPP
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
|
||||
class BOOST_REGEX_DECL abstract_protected_call
|
||||
{
|
||||
public:
|
||||
bool BOOST_REGEX_CALL execute()const;
|
||||
private:
|
||||
virtual bool call()const = 0;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class concrete_protected_call
|
||||
: public abstract_protected_call
|
||||
{
|
||||
public:
|
||||
typedef bool (T::*proc_type)();
|
||||
concrete_protected_call(T* o, proc_type p)
|
||||
: obj(o), proc(p) {}
|
||||
private:
|
||||
virtual bool call()const;
|
||||
T* obj;
|
||||
proc_type proc;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
bool concrete_protected_call<T>::call()const
|
||||
{
|
||||
return (obj->*proc)();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user