Live data from Hacker News

Show HN: C++ runtime/compile-time detection in constexpr functions

github.com

21–22 of 22 posts

Re: Show HN: C++ runtime/compile-time detection in constexpr functions

#21

As with most things in C++ that looks horribly convoluted for some very simple functionality. In D all we have to do is: * `if ( __ctfe) { ... }` for compile time * `if (!__ctfe) { ... }` for runtime

I don't think it's any secret D does CTFE better than any other language.

Yeah it never ceases to amaze me the lengths that C++ users goto to try to do things at compile time.

Re: Show HN: C++ runtime/compile-time detection in constexpr functions

#22

As with most things in C++ that looks horribly convoluted for some very simple functionality. In D all we have to do is: * `if ( __ctfe) { ... }` for compile time * `if (!__ctfe) { ... }` for runtime

Thanks, strangely enough this comment made me read more about D and I'm genuinely excited about getting into this language now
Post reply on HN