Share C++ code with CodeThis
C++ snippets with templates, concepts, and the standard library — all highlighted correctly.
Paste C++ nowWhat you get
- C++-aware syntax highlighting via CodeMirror
- Instant shareable link — no signup required
- Optional expiration (7 days, 30 days, permanent)
- Password protection for private pastes
- Works with the REST API and MCP server
- Rich markdown and MDC components alongside code
Common use cases for C++ pastes
- Compiler Explorer companions
- Template metaprogramming demos
- Algorithm implementations
- Performance comparisons
Example
#include <vector>
#include <algorithm>
#include <iostream>
int main() {
std::vector<int> v{5, 2, 8, 1, 9};
std::ranges::sort(v);
for (int n : v) std::cout << n << ' ';
}
Related languages
Ready to share some C++?