2016-02-05 29 views
0

我的問題是關於Uncrustify 0.62和lambdas。什麼uncrustify.cfg選項都可以像這樣格式化代碼:lambda的uncrustify選項

void f1b() 
{ 
    std::for_each(a, b, 
        [ ] (int& b) -> foo 
    { 
     b += 3; 
     return(beer); 
    } 
       ); 

} 

像這樣的代碼:

void f1b() 
{ 
    std::for_each(a, b, 
       [] (int& b) -> foo 
       { 
        b += 3; 
        return(beer); 
       } 
       ); 
} 

注:現在,接下來的幾行:

nl_cpp_lambda_leave_one_liners=false 
nl_cpp_ldef_brace=add 
sp_cpp_lambda_assign=add 

在uncrustify.cfg。

Thanx。

回答

0

你可能會喜歡這樣的:

indent_paren_open_brace=true