#C++ Preprocessors in Rust?

5 messages · Page 1 of 1 (latest)

unkempt bloom
#

I was wondering if there is an equivalent for the following code in rust:

#ifdef DEBUG
#define Log(x) std::cout << x << std::endl
#else
#define Log(x)
#endif
placid fern
#

If you have a complex cfg chain, use the cfg-if crate, the "basic" syntax can be unwieldy

unkempt bloom
#

Thank you!
Can you write the same example with macros?
I want to understand how you do it in both ways 🙂

placid fern