Closed Bug 1538081 Opened 6 years ago Closed 6 years ago

add a C++ macro that acts like Rust's dbg!()

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: heycam, Assigned: heycam)

Details

Attachments

(5 files)

Lately I've found the Rust dbg!() macro very useful! I'd like something in C++ to use that works the same way -- that is, prints out the expression passed to it, then returns it.

Happy to hear ideas for a better macro name too.

Assignee: nobody → cam
Status: NEW → ASSIGNED
Attachment #9053016 - Attachment description: Bug 1538081 - Add MOZ_DBG macro. → Bug 1538081 - Part 1: Add MOZ_DBG macro.

Depends on D24583

Depends on D25024

Pushed by cmccormack@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/113ac188a69e Part 1: Add MOZ_DBG macro. r=froydnj,gerald https://hg.mozilla.org/integration/autoland/rev/26df801e44db Part 2: Add MOZ_DEFINE_DBG. r=froydnj,gerald https://hg.mozilla.org/integration/autoland/rev/d6d331abbf0e Part 3: Add operator<<(ostream&) definitions for a few common types. r=froydnj,gerald https://hg.mozilla.org/integration/autoland/rev/ced61a86c74c Part 4: Tests. r=froydnj,gerald
Pushed by cmccormack@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b9e91906edae Part 1: Add MOZ_DBG macro. r=froydnj,gerald https://hg.mozilla.org/integration/autoland/rev/3ae52b39cf6f Part 2: Add MOZ_DEFINE_DBG. r=froydnj,gerald https://hg.mozilla.org/integration/autoland/rev/a01e770ef4f5 Part 3: Add operator<<(ostream&) definitions for a few common types. r=froydnj,gerald https://hg.mozilla.org/integration/autoland/rev/ac91a1c2e3f5 Part 4: Tests. r=froydnj,gerald
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: