Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
opm
core
utility
Event_impl.hpp
Go to the documentation of this file.
1
// Copyright (C) 2013 Uni Research AS
2
// This file is licensed under the GNU General Public License v3.0
3
4
#ifndef OPM_EVENT_HEADER_INCLUDED
5
#error Do NOT include this file directly!
6
#endif
/* OPM_EVENT_HEADER_INCLUDED */
7
8
template
<
typename
T,
void
(T::*member)()>
inline
Event&
9
Event::add (T& t) {
10
// wrap the member function in a std::function and add that
11
// notice the use of ref() to avoid invoking the copy constructor
12
return
this->add (std::bind (member, std::ref(t)));
13
}