当函数调用参数较长时,在开括号后换行,换行后的第一个参数应该如何缩进,缩进多少
- User
当函数调用参数较长时,在开括号后换行,换行后的第一个参数应该如何缩进,缩进多少
Assistant
当函数调用参数较长时,换行后的缩进有几种常见的标准做法:
1. 与开括号对齐(最常见)
cppadd_ints_server_ = this->create_service<example_interfaces::srv::AddTwoInts>( "add_two_ints_srv", std::bind(&ServiceServer01::handle_add_two_ints, this, std::placeholders::_1, std::placeholders::_2));2. 固定缩进(通常4个空格或1个tab)
cpp
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.