Skip to content

Commit bc7f0a1

Browse files
committed
libtock: comment defer
1 parent 8d7d488 commit bc7f0a1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libtock/defer.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#pragma once
22

3+
// Implementation of the C `defer {}` feature.
4+
//
5+
// As of July 2025, upcoming versions of C will support `defer` as a way to run
6+
// code when a value goes out of scope. See:
7+
// https://thephd.dev/_vendor/future_cxx/technical%20specification/C%20-%20defer/C%20-%20defer%20Technical%20Specification.pdf
8+
//
9+
// This implements the same feature with a macro. This implementation used from
10+
// https://gustedt.wordpress.com/2025/01/06/simple-defer-ready-to-use/.
11+
312
#ifdef __cplusplus
413
extern "C" {
514
#endif

0 commit comments

Comments
 (0)