How to make clang-format put braces on the same line as function body?

55 Views Asked by At

Is it possible to configure clang-format so that it puts braces on the same line as function body, provided it fits within the column width. To put it into code:

// Provided this exceeds the column limit ...
const void* address() const noexcept { return &_data[0]; }

// ... I want it to be formatted like this ...
const void* address() const noexcept
{ return &_data[0]; }

// ... but all I can get is either this ...
const void* address() const noexcept
{
  return &_data[0];
}

// ... or this!
const void* address() const noexcept {
  return &_data[0];
}

Is this possible and, if not, why? Should I open a feature request?

0

There are 0 best solutions below