Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. cpp-dump

cpp-dump

MITC++v0.7.0

A C++ header-only library for debugging that prints variables of any type with auto-formatting and syntax highlighting.

GitHubGitHub
381 stars15 forks0 contributors

What is cpp-dump?

cpp-dump is a C++ debugging library that provides a `cpp_dump()` macro to print variables of any type, similar to Python's `print()` or JavaScript's `console.log()`. It automatically formats output with indentation, colored syntax, and support for user-defined types, making variable inspection quick and readable during development.

Target Audience

C++ developers who need a quick, zero-configuration debugging tool for inspecting complex data structures like nested containers, maps, and custom types during development or competitive programming.

Value Proposition

Developers choose cpp-dump for its header-only, dependency-free design, extensive type support including standard library containers and user-defined types, and customizable output with syntax highlighting and over 20 manipulators for fine-grained control.

Overview

A C++ library for debugging purposes that can print any variable, even user-defined types.

Use Cases

Best For

  • Debugging nested C++ containers like vectors of vectors or maps with complex values.
  • Inspecting user-defined types without writing custom print functions, using macros or operator<<.
  • Competitive programming where quick variable inspection is needed, with configurable output for local builds.
  • Development environments requiring colored, IDE-like syntax highlighting for debug output.
  • Projects needing a zero-dependency, header-only debugging library that works out of the box.
  • Scenarios where auto-indentation and line-width formatting improve readability of large data structures.

Not Ideal For

  • Production systems requiring high-performance, structured logging with minimal overhead
  • Environments without terminal support for ANSI escape sequences, such as embedded systems or some IDEs
  • Projects already integrated with full-featured debugging frameworks like GDB or Google Test

Pros & Cons

Pros

Wide Type Support

Automatically prints standard library containers (vectors, maps, sets), pointers, and user-defined types via macros or operator<<, without requiring custom print functions for each type.

Auto-Indentation and Formatting

Formats nested structures to fit within a configurable line width (default 160), improving readability of complex data structures like multi-dimensional vectors.

Colored Output

Provides customizable syntax highlighting with escape sequences, resembling IDE debuggers, and supports themes for both light and dark terminals.

Header-Only and Zero Dependencies

No build or external dependencies required; simply include the header file, making it easy to integrate into any C++17+ project.

Extensive Manipulators

Offers over 20 manipulators to control display style, such as omitting container parts, showing indexes, or changing number bases, allowing fine-grained debug output customization.

Cons

Complex Configuration Overhead

Advanced features like custom colors, user-defined type macros, and manipulators require understanding of numerous options and macros, which can be overwhelming for simple use cases.

Performance and Recursion Limits

Recursive printing with configurable max_depth and max_iteration_count can introduce overhead and may truncate output for very large or deep data structures, limiting its use in performance-critical debugging.

Development-Only Focus

Designed primarily for quick inspection during development, with output defaulting to std::clog; it lacks built-in features for production logging like log levels or easy file output without customization.

Frequently Asked Questions

Quick Stats

Stars381
Forks15
Contributors0
Open Issues2
Last commit1 year ago
CreatedSince 2023

Tags

#syntax-highlighting#cpp17#c-plus-plus#auto-formatting#development-tools#competitive-programming#debugging#cpp#header-only

Built With

C
C++17

Included in

C/C++70.6k
Auto-fetched 1 day ago

Related Projects

Google MockGoogle Mock

GoogleTest - Google Testing and Mocking Framework

Stars38,943
Forks10,849
Last commit2 days ago
googletestgoogletest

GoogleTest - Google Testing and Mocking Framework

Stars38,943
Forks10,849
Last commit2 days ago
Catch2Catch2

A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)

Stars21,428
Forks3,499
Last commit1 day ago
benchmarkbenchmark

A microbenchmark support library

Stars10,356
Forks1,792
Last commit4 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub