6

Is it possible to print a message when a test on a compile time constexpr evalates true? Something like static_assert without stopping the compiler.

constexpr Application::Mode SETUP_MODE = Application::Debug;

// Can I somehow test if the SETUP_MODE is debug for pragma message?
#pragma message("Application mode is set to Debug!")

static_assert(SETUP_MODE != Application::Debug, 
    "Application mode is set to Debug!"); // Can I somehow just print this message without aborting the compilation?
Adam Hunyadi
  • 1,890
  • 16
  • 32

0 Answers0