Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
constexpr internal error
#include <iostream> class StringView { public: constexpr StringView(const char* start_, const char* end_): start(start_), end(end_) {} constexpr uintptr_t Length() const {return end-start;} //internal compiler error private: const char* start; const char* end; }; int main() { constexpr const char* const str = "Test string"; enum: uintptr_t {LENGTH = StringView(str, str + 5).Length()}; std::cout << LENGTH << std::endl; return 0; }
run
|
edit
|
history
|
help
0
sharedptr emptiness
namespace name resolution
Enum Class Comparisons
ADL of operator expression & unqualified function call
SFINAE with std::enable_if
32
error_check
VC++ latest rejects istream to nullptr comparison
Competitive - Algorithm for max number of superior characters
Static cast of Enum