AI SummaryA Copilot instruction set that standardizes C++ coding style, documentation, and visibility/linkage practices for Boost-compatible libraries. Developers working on C++ projects requiring consistent standards and proper ABI handling will benefit from these guidelines.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "buffers — Copilot Instructions" prompt rules to my project. Repository: https://github.com/cppalliance/buffers Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
Asio Buffers without the Asio
Examples
`cpp /** Return the size of the buffer sequence. @param buffers The buffer sequence to measure. @return The total byte count. */ template<class BufferSequence> std::size_t buffer_size(BufferSequence const& buffers); ` No @tparam needed—BufferSequence is evident from @param buffers. `cpp /** Return the default value. @tparam T The value type. */ template<class T> T default_value(); ` @tparam needed—T has no corresponding function parameter.
vtable requirements
• Construction/destruction requires vtable (vptr initialization) • dynamic_cast/typeid require typeinfo • Polymorphic class crossing DLL boundary: MUST export vtable
Code Style
• C++11 unless otherwise specified • Boost C++ Libraries naming conventions (snake_case) • 4-space indentation, no tabs • Braces on their own line for classes/functions • "detail" namespace symbols are never public • public headers in "include/" • library cpp and private header files in "src/" • test files in "test/" • Prefer RAII rollback guards over try-catch for cleanup • No ABI compatibility guarantee in different Boost version
Javadoc Documentation
Follow Boost C++ Libraries Javadoc style: • Brief descriptions on first line after /** • Functions returning values: brief starts with "Return" • Use @param for function parameters • Use @tparam for template parameters, except: • Variadic args (Args...) — omit • Types deduced from function parameters — omit (self-evident from @param) • Use @return for return value details • Use @pre for preconditions • Use @post for postconditions • Use @throws for exceptions • Use @note for important notes • Use @see for cross-references • Use @code / @endcode for examples
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts