C++

Share C++ code online.

Share modern C++ code, template metaprogramming, or STL patterns: highlighted and encrypted instantly.

textdrop.sh/xk4mR2
1#include <algorithm>2#include <ranges>3#include <vector>4#include <string>56struct Employee {7    std::string name;8    int         department;9    double      salary;10};1112auto top_earners_by_dept(13    const std::vector<Employee>& employees,14    int dept,15    size_t n16) {17    auto in_dept = employees18        | std::views::filter([dept](const auto& e) {19            return e.department == dept;20          });2122    std::vector<Employee> result(in_dept.begin(), in_dept.end());23    std::partial_sort(result.begin(),24                      result.begin() + std::min(n, result.size()),25                      result.end(),26                      [](const auto& a, const auto& b) {27                          return a.salary > b.salary;28                      });29    return result;30}
Every paste includes

C++ syntax highlighting

Paste C++ code and get a shareable link with full syntax highlighting, server-side rendered with no JavaScript overhead.

Burn after read

Deleted on first open. Can't be viewed twice.

Password protection

Add a password for end-to-end encryption with no raw key stored.

Configurable expiry

Set pastes to expire after 1 hour, 1 day, 7 days, or up to 30 days. Gone when you say so.

No account needed

No sign-up, no email, no ads. Paste and share in seconds.

How it works
Plain Text
Markdown
Code
DB_HOST=db-01.prod.internal
DB_USER=api_svc
DB_PASS=xK9$mP2!qR7nLw2
REDIS_URL=redis://:abc@cache:6379
delete after setup — expires 1hr
7 days
Share
textdrop.sh/
7 days · plain text
Use cases
  • 01Share template metaprogramming patterns
  • 02Send STL algorithm usage examples
  • 03Share RAII / smart pointer patterns
  • 04Distribute game engine snippets
  • 05Send modern C++20 ranges examples
FAQ
Does the highlighter support C++20 / C++23 syntax?+

Yes. The grammar supports concepts, coroutines, ranges, and structured bindings.

Can I share .hpp header files?+

Yes. Select C++ as the language and paste your header content.

Is my code encrypted?+

Yes. AES-256-GCM encryption runs in your browser before upload. Non-password pastes store the raw data key server-side for simple sharing and raw access; password-protected pastes keep the raw key out of the server.

Other languages
Drop your code