sideFunc.hpp
Go to the documentation of this file.
1
3#pragma once
4
5#include "indep/macro/overload.hpp"
6
7#define BY_SIDE_FUNC_1(name) BY_SIDE_FUNC_2(it, name)
8#define BY_SIDE_FUNC_2(paramPtr, name) BY_SIDE_FUNC_3(it, name(*it), decltype(name(*it))())
9#define BY_SIDE_FUNC_3(paramPtr, expr, ret) \
10 { return paramPtr ? expr : ret; }
11#define BY_SIDE_FUNC(...) BY_OVERLOAD(BY_SIDE_FUNC, __VA_ARGS__)