I am trying to configure my cc-styles to use a single basic offset for the braces of an inline defined lambda.
I have a function template which takes a functor as an argument
template<typename Func>
void some_function(Func f)
{
// ...
}
I am calling this function with a lambda, defined inline at the call site:
some_function([](int foo)
{
// ...
});
Notice how the opening and closing braces of the body of the lambda are aligned with the capture statement.
Our coding standards require that the braces are indented by one indent. As such, I am required to have the code look like the following:
some_function([](int foo)
{
// ...
});
Question:
What do I need to specify in c-offsets-alist
to get the indent I'm looking for?
Notes:
Here is the c-add-style
call I'm making, in case that's of some use:
(c-add-style "work"
'((indent-tabs-mode . nil)
(c-basic-offset . 4)
(c-offsets-alist
(substatement-open . 0)
(case-label . +)
(inline-open . 0)
(block-open . 0)
(statement-cont . +)
(inextern-lang . 0)
(innamespace . 0))))