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:
Danny Robson 2011-07-16 14:47:56 +10:00
parent 64448e7e5e
commit d6b943500c
2 changed files with 41 additions and 40 deletions

View File

@ -21,4 +21,4 @@
#include "signal.hpp"
// Instance something probably useful here so that we generate early compile/link errors.
template class signal <void>;
template class util::signal <void>;

View File

@ -24,9 +24,9 @@
#include <vector>
#include <functional>
template <typename Ret, typename ...Args>
class signal {
namespace util {
template <typename Ret, typename ...Args>
class signal {
public:
typedef Ret (*callback_function)(Args...);
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)
(*i)(tail...);
}
};
};
}
#endif // __SIGNAL_HPP