MCPcopy Create free account
hub / github.com/catboost/catboost / TImplicitlyCastable

Class TImplicitlyCastable

util/generic/ptr_ut.cpp:541–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539namespace {
540 template <class TFrom, class TTo>
541 struct TImplicitlyCastable {
542 struct RTYes {
543 char t[2];
544 };
545
546 using RTNo = char;
547
548 static RTYes Func(TTo);
549 static RTNo Func(...);
550 static TFrom Get();
551
552 /*
553 * Result == (TFrom could be converted to TTo implicitly)
554 */
555 enum {
556 Result = (sizeof(Func(Get())) != sizeof(RTNo))
557 };
558 };
559
560 struct TImplicitlyCastableToBool {
561 inline operator bool() const {

Callers

nothing calls this directly

Calls 2

FuncFunction · 0.70
GetFunction · 0.50

Tested by

no test coverage detected