NuTo
Numerics Tool
Bind.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace NuTo
7 {
8 
11 template <typename TObject, typename TReturn>
12 auto Bind(TObject& object, TReturn (TObject::*f)(const NuTo::CellIpData&, double))
13 {
14  return [&object, f](const NuTo::CellIpData& cellIpData) { return (object.*f)(cellIpData, /* deltaT = */ 0.); };
15 }
18 template <typename TObject, typename TReturn>
19 auto Bind(TObject& object, TReturn (TObject::*f)(const NuTo::CellIpData&))
20 {
21  return [&object, f](const NuTo::CellIpData& cellIpData) { return (object.*f)(cellIpData); };
22 }
23 
24 
25 } /* NuTo */
Similar to NuTo::CellData.
Definition: CellIpData.h:14
Definition: Exception.h:6
auto Bind(TObject &object, TReturn(TObject::*f)(const NuTo::CellIpData &, double))
automatically create the lambda [&](cellIpData) {return integrand.Gradient(cellIpData, 0); }
Definition: Bind.h:12