3
명시 적 (bool)의 유스 케이스는 무엇입니까
C ++ 20은 생성시 명시 적 으로 여부를 컴파일 타임에 조건부로 선택하는 명시 적 (bool) 을 도입했습니다 . 아래는 내가 발견 한 예입니다 여기가 . struct foo { // Specify non-integral types (strings, floats, etc.) require explicit construction. template <typename T> explicit(!std::is_integral_v<T>) foo(T) {} }; foo a = 123; // …