Skip to content
Snippets Groups Projects
Commit 1e3f9d83 authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Use perfect forwarding in MakeBlockDataInitFunction

parent aff8c9ae
Branches
Tags
No related merge requests found
...@@ -34,19 +34,19 @@ namespace domain_decomposition { ...@@ -34,19 +34,19 @@ namespace domain_decomposition {
/// \cond internal /// \cond internal
namespace internal namespace internal
{ {
template<class T, class ... P> template<class T, typename... Args>
T * newFunc( const IBlock* const, const P & ... p ) { T * newFunc( const IBlock* const, Args&... args ) {
return new T(p...); return new T(args...);
} }
} // namespace internal } // namespace internal
/// \endcond /// \endcond
template<class T, class ... P> template<class T, typename... Args>
std::function< T* ( const IBlock* const block ) > std::function< T* ( const IBlock* const block ) >
makeBlockDataInitFunction(const P & ... p) { makeBlockDataInitFunction(Args&&... args) {
return std::bind( internal::newFunc<T,P...>, std::placeholders::_1, p... ); return std::bind( internal::newFunc<T,Args...>, std::placeholders::_1, std::forward<Args>(args)... );
} }
......
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