ConditionalActions through std::function Lambdas So I just experimented with some code to make a huge if-else construct more human readable, extendable and configurable (switch positions of conditions).

The idea was to have a vector that contains all conditions and their actions and then just iterate over the vector, executing their ConditionalAction.

I solved it with lambdas with capture so I could use membervariables of the class where the ConditionalActions() method is implemented as well as additional parameters without having to define parameters in the std::function declaration.

Additionally I outsourced the CConditionalAction definitions to another header that I included in the method itself. This is the main part that is causing a hassle with colleagues.

So

void ElseIfConstruct()
{
    int SomeVariable = 0;

    if(FirstCondition)
    {
        FirstAction(); // uses membervariables
    }
    else if (SecondCondition)
    {
        SecondAction(SomeVariable); // void SecondAction(&amp;int refParameter)
    }
    //else if ... and so on
    else
    {
        LastAction();
    }
}


becomes

MyConditionalActions.h

#ifdef USE_CONDITIONAL_ACTIONS 
// ifdef so the compiler does not try to compile.
// alternatively exclude it from build.

CConditionalAction FirstConditionalAction([&amp;]()
{
    if (false)
    {
        return true;
    }
    return false;
});

CConditionalAction SecondConditionalAction([&amp;]()
{
    if (false)
    {
        return true;
    }
    return false;
});

CConditionalAction LastConditionalAction([&amp;]()
{
    if (true)
    {
        return true;
    }
    return false;
});

#endif


ConditionalAction.h

#include &lt;functional&gt;

class CConditionalAction
{
public:
    CConditionalAction(std::function&lt;bool()&gt; ConditionalAction)
    : m_ConditionalAction(ConditionalAction) {}

    bool operator()() const { return m_ConditionalAction(); }
    std::function&lt;bool()&gt; m_ConditionalAction = nullptr;
};


MyClass.cpp

#include "ConditionalAction.h"
#include &lt;vector&gt;

void ConditionedActions()
{
    #define USE_CONDITIONAL_ACTIONS 
    #include "MyConditionalActions.h"
    #undef USE_CONDITIONAL_ACTIONS 

    // the vector will later be created just once but could also be used to sort out
    // ConditionalActions that don't have to be tested at all in runtime.

    std::vector&lt;CConditionalAction&gt; vecConditionalActions;
    vecConditionalActions.push_back(FirstConditionalAction);
    vecConditionalActions.push_back(SecondConditionalAction);
    //vecConditionalActions.push_back(MoreConditionalActions);
    vecConditionalActions.push_back(LastConditionalAction);

    for (const auto&amp; ConditionalAction : vecConditionalActions)
    {
        if (ConditionalAction())
        {
            return;
        }
    }
}


Restructuring then becomes a copy-paste in MyClass.cpp
Extending becomes a push_back into the vector in MyClass.cpp and a copy-paste with adjustments in the MyConditionalActions.h
This is long winded:
std::vector&lt;CConditionalAction&gt; vecConditionalActions;
vecConditionalActions.push_back(FirstConditionalAction);
vecConditionalActions.push_back(SecondConditionalAction);
//vecConditionalActions.push_back(MoreConditionalActions);
vecConditionalActions.push_back(LastConditionalAction);

Easier to use the constructor to put everything in place.
std::vector&lt;CConditionalAction&gt; vecConditionalActions
    {
        FirstConditionalAction,
        SecondConditionalAction,
        // MoreConditionalActions,
        LastConditionalAction
    };

// Note: You should probably make that a static variable so it is
//       only built once the first time it is created.

I don't see the point in writing a functor to hold a functor (a lambda) then wrap that in a functor (std::function) to hold in a vector. The whole CConditionalAction class is not necessary.
std::vector&lt;std::function&lt;bool()&gt;&gt; vecConditionalActions {
        [&amp;](){if (false){return true;}return false;},
        ....
    };
        

I am surprised this compiles:
std::function&lt;bool()&gt; m_ConditionalAction = nullptr;
                                      ///   ^^^^^^^^

But it does. But what does it mean? Not sure. Not sure I want to find out either as there is no pointer semantics involved here. But since you have a constructor this will never be activated anyway. Writing code that has no clear meaning is a bad idea.
I am assuming your code in the lambdas is just example code as it does nothing.
Final Thought.
The point of this exercise was:

to make a huge if-else construct more human readable, extendable and configurable (switch positions of conditions)

I don't think you have a succeeded. I think this code just makes the code more obscure by hiding the actions in a separate file.