Commit 1e3f9d83 authored by Michael Kuron's avatar Michael Kuron
Browse files

Use perfect forwarding in MakeBlockDataInitFunction

parent aff8c9ae
......@@ -34,19 +34,19 @@ namespace domain_decomposition {
/// \cond internal
namespace internal
{
template<class T, class ... P>
T * newFunc( const IBlock* const, const P & ... p ) {
return new T(p...);
template<class T, typename... Args>
T * newFunc( const IBlock* const, Args&... args ) {
return new T(args...);
}
} // namespace internal
/// \endcond
template<class T, class ... P>
template<class T, typename... Args>
std::function< T* ( const IBlock* const block ) >
makeBlockDataInitFunction(const P & ... p) {
return std::bind( internal::newFunc<T,P...>, std::placeholders::_1, p... );
makeBlockDataInitFunction(Args&&... args) {
return std::bind( internal::newFunc<T,Args...>, std::placeholders::_1, std::forward<Args>(args)... );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment