Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "static_todo.hpp"

// global namespace
TODO_BEFORE(12, 2018, "update this example to pass the CI");
TODO_BEFORE(12, 2020, "update this example to pass the CI");

int main() {
// inside a function
FIXME_BEFORE(01, 2019, "update this example to pass the CI");
FIXME_BEFORE(01, 2020, "update this example to pass the CI");
}
4 changes: 2 additions & 2 deletions static_todo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ constexpr int current_build_month() {
/// Example:
/// TODO_BEFORE(01, 2019, "refactor to use std::optional<> once we compile in C++17 mode");
#define TODO_BEFORE(month, year, msg) \
static_assert((year >= 2018 && month > 0 && month <= 12) && \
static_assert((year >= 2019 && month > 0 && month <= 12) && \
(current_build_year() < year || \
(current_build_year() == year && current_build_month() < month)), \
"TODO: " msg)

/// FIXME_BEFORE() works the same way than TODO_BEFORE() but triggers a "FIXME" error instead
#define FIXME_BEFORE(month, year, msg) \
static_assert((year >= 2018 && month > 0 && month <= 12) && \
static_assert((year >= 2019 && month > 0 && month <= 12) && \
(current_build_year() < year || \
(current_build_year() == year && current_build_month() < month)), \
"FIXME: " msg)