|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +## Code Style |
| 4 | + |
| 5 | +- C++11 unless otherwise specified |
| 6 | +- Boost C++ Libraries naming conventions (snake_case) |
| 7 | +- 4-space indentation, no tabs |
| 8 | +- Braces on their own line for classes/functions |
| 9 | +- Symbols in "detail" namespaces are never public |
| 10 | +- public headers in "include/" |
| 11 | +- library cpp files in "src/" |
| 12 | + |
| 13 | +## Javadoc Documentation |
| 14 | + |
| 15 | +Follow Boost C++ Libraries Javadoc style: |
| 16 | + |
| 17 | +- Brief descriptions on first line after `/**` |
| 18 | +- Functions returning values: brief starts with "Return" |
| 19 | +- Use `@param` for function parameters |
| 20 | +- Use `@tparam` for template parameters, except: |
| 21 | + - Variadic args (`Args...`) — omit |
| 22 | + - Types deduced from function parameters — omit (self-evident from `@param`) |
| 23 | +- Use `@return` for return value details |
| 24 | +- Use `@pre` for preconditions |
| 25 | +- Use `@post` for postconditions |
| 26 | +- Use `@throws` for exceptions |
| 27 | +- Use `@note` for important notes |
| 28 | +- Use `@see` for cross-references |
| 29 | +- Use `@code` / `@endcode` for examples |
| 30 | + |
| 31 | +## Examples |
| 32 | + |
| 33 | +```cpp |
| 34 | +/** Return the size of the buffer sequence. |
| 35 | +
|
| 36 | + @param buffers The buffer sequence to measure. |
| 37 | +
|
| 38 | + @return The total byte count. |
| 39 | +*/ |
| 40 | +template<class BufferSequence> |
| 41 | +std::size_t |
| 42 | +buffer_size(BufferSequence const& buffers); |
| 43 | +``` |
| 44 | +
|
| 45 | +No `@tparam` needed—`BufferSequence` is evident from `@param buffers`. |
| 46 | +
|
| 47 | +```cpp |
| 48 | +/** Return the default value. |
| 49 | +
|
| 50 | + @tparam T The value type. |
| 51 | +*/ |
| 52 | +template<class T> |
| 53 | +T default_value(); |
| 54 | +``` |
| 55 | + |
| 56 | +`@tparam` needed—`T` has no corresponding function parameter. |
| 57 | + |
| 58 | +## Preferences |
| 59 | + |
| 60 | +- Concise, dry answers |
| 61 | +- Full files, not diffs |
| 62 | +- Accurate, compiling C++ code |
0 commit comments