Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/129.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 当有换行符时,clang格式会在if条件下删除缩进_C++_Clang Format - Fatal编程技术网

C++ 当有换行符时,clang格式会在if条件下删除缩进

C++ 当有换行符时,clang格式会在if条件下删除缩进,c++,clang-format,C++,Clang Format,我有这个功能: bool WS::receive(MB *const buffer) const { updateLastPackage(); if ((!lastPackage_.empty()) && (lastPackage_.size() <= buffer->capacity()) && (lastUpdate_.getTime() <= settings_.refresh

我有这个功能:

bool WS::receive(MB *const buffer) const {
    updateLastPackage();
    if ((!lastPackage_.empty()) &&
            (lastPackage_.size() <= buffer->capacity()) &&
            (lastUpdate_.getTime() <= settings_.refreshPeriod)) {
        buffer->clear();
        (*buffer) << lastPackage_;
        return true;
    }
    return false;
}
bool WS::receive(MB*常量缓冲区)常量{
updateLastPackage();
如果((!lastPackage_uu.empty())&&
(lastPackage.size()容量()&&
(lastUpdate.getTime()清除();

(*buffer)感谢Yksisarvinen

解决方案:

AlignOperands: false
ContinuationIndentWidth: 8

它似乎被AlignOperators覆盖,但要实际添加一些缩进,您需要修改ContinuationIndentWidth,这可能会更改代码的其他部分。您的意思是删除
if
条件中的缩进,而不是函数参数吗?@cigien是的,对不起,我的错误
AlignOperands: false
ContinuationIndentWidth: 8