}
} // namespace sc_core
-
-namespace sc_unnamed
-{
-
-ImplementationDefined _1;
-ImplementationDefined _2;
-ImplementationDefined _3;
-ImplementationDefined _4;
-ImplementationDefined _5;
-ImplementationDefined _6;
-ImplementationDefined _7;
-ImplementationDefined _8;
-ImplementationDefined _9;
-
-} // namespace sc_unnamed
#ifndef __SYSTEMC_EXT_CORE_SC_SPAWN_HH__
#define __SYSTEMC_EXT_CORE_SC_SPAWN_HH__
+#include <functional>
#include <vector>
#include "sc_join.hh"
return sc_process_handle() = p;
}
-#define sc_bind boost::bind
-#define sc_ref(r) boost::ref(r)
-#define sc_cref(r) boost::cref(r)
-
#define SC_FORK \
{ \
::sc_core::sc_process_handle forkees[] = {
join.wait_clocked(); \
}
+// This avoids boost introduces a dependency on c++11. If that's a problem,
+// we could imitate Accellera and pick which one to use on the fly.
+
+template <typename F, typename... Args>
+auto sc_bind(F &&f, Args && ...args) ->
+ decltype(std::bind(std::forward<F>(f), std::forward<Args>(args)...))
+{
+ return std::bind(std::forward<F>(f), std::forward<Args>(args)...);
+}
+
+template <typename T>
+auto sc_ref(T &&v) -> decltype(std::ref(std::forward<T>(v)))
+{
+ return std::ref(std::forward<T>(v));
+}
+
+template <typename T>
+auto sc_cref(T &&v) -> decltype(std::cref(std::forward<T>(v)))
+{
+ return std::cref(std::forward<T>(v));
+}
} // namespace sc_core
+using sc_core::sc_bind;
+using sc_core::sc_ref;
+using sc_core::sc_cref;
+
namespace sc_unnamed
{
-typedef int ImplementationDefined;
-extern ImplementationDefined _1;
-extern ImplementationDefined _2;
-extern ImplementationDefined _3;
-extern ImplementationDefined _4;
-extern ImplementationDefined _5;
-extern ImplementationDefined _6;
-extern ImplementationDefined _7;
-extern ImplementationDefined _8;
-extern ImplementationDefined _9;
+using namespace std::placeholders;
} // namespace sc_unnamed