C++ (Qt) auto traverseGrid = [](const NumberGrid &numberGrid, std::function<const NumberCell &(const NumberGrid &numberGrid, uchar m, uchar a)> getCell) { getCell(numberGrid, 0, 1); }; traverseGrid(_leftNumberGrid, [](const NumberGrid &numberGrid, uchar m, uchar a) { return numberGrid.cellAt(m, a); }); traverseGrid(_topNumberGrid, [](const NumberGrid &numberGrid, uchar m, uchar a) { return numberGrid.cellAt(a, m); });
traverseGrid(_leftNumberGrid, (numberGrid, m, a) => { return numberGrid.cellAt(m, a); });
traverseGrid(_leftNumberGrid, [](const NumberGrid &numberGrid, uchar m, uchar a) { return numberGrid.cellAt(m, a); });
C++ (Qt)template <class R, class Arg, class F>R traverseGrid(const Arg & arg, F function){ return function(arg, 0, 1);} traverseGrid(_leftNumberGrid, [](const NumberGrid &numberGrid, uchar m, uchar a) { return numberGrid.cellAt(m, a); });traverseGrid(_topNumberGrid, [](const NumberGrid &numberGrid, uchar m, uchar a) { return numberGrid.cellAt(a, m); });
C++ (Qt)std::function<uchar (const NumberGrid&, uchar, uchar)> traverseGrid = &NumberGrid::cellAt; traverseGrid(_leftNumberGrid, m, a);traverseGrid(_topNumberGrid, a, m);
C++ (Qt)std::function<const NumberCell &(const NumberGrid &numberGrid, uchar m, uchar a)> x = &NumberGrid::cellAt;
C++ (Qt)template <class Cell>class Grid{ Cell &cellAt(uchar row, uchar column); const Cell &cellAt(uchar row, uchar column) const;}; class NumberGrid : public Grid<NumberCell> {}
C++ (Qt)std::function<const NumberCell &(const NumberGrid &, uchar, uchar)> x = &NumberGrid::cellAt;
C++ (Qt)auto x = &NumberGrid::cellAt;
C++ (Qt) using boost::phoenix::arg_names::arg1;auto it = std::find_if(container.begin(), container.end(), arg1 == key);
C++ (Qt)typedef const NumberCell & (NumberGrid::*const_mem_fun_type)(uchar, uchar) const;typedef NumberCell & (NumberGrid::*mem_fun_type)(uchar, uchar); std::function<const NumberCell &(const NumberGrid &, uchar, uchar)> x = static_cast<const_mem_fun_type>(&NumberGrid::cellAt);