Move signal into namespace util
signal will clash with the POSIX signal function. This tends to be too annoying to work around with careful inclusion orders or other namespacing.
This commit is contained in:
parent
64448e7e5e
commit
d6b943500c
@ -21,4 +21,4 @@
|
|||||||
#include "signal.hpp"
|
#include "signal.hpp"
|
||||||
|
|
||||||
// Instance something probably useful here so that we generate early compile/link errors.
|
// Instance something probably useful here so that we generate early compile/link errors.
|
||||||
template class signal <void>;
|
template class util::signal <void>;
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
namespace util {
|
||||||
template <typename Ret, typename ...Args>
|
template <typename Ret, typename ...Args>
|
||||||
class signal {
|
class signal {
|
||||||
public:
|
public:
|
||||||
typedef Ret (*callback_function)(Args...);
|
typedef Ret (*callback_function)(Args...);
|
||||||
typedef std::function<Ret(Args...)> callback_object;
|
typedef std::function<Ret(Args...)> callback_object;
|
||||||
@ -71,6 +71,7 @@ class signal {
|
|||||||
for (auto i = m_children.begin (), end = m_children.end (); i != end; ++i)
|
for (auto i = m_children.begin (), end = m_children.end (); i != end; ++i)
|
||||||
(*i)(tail...);
|
(*i)(tail...);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#endif // __SIGNAL_HPP
|
#endif // __SIGNAL_HPP
|
||||||
|
Loading…
Reference in New Issue
Block a user