typeid.cxx

来自「SP是一个基于GNU C++编译器」· CXX 代码 · 共 29 行

CXX
29
字号
// Copyright (c) 1994 James Clark// See the file COPYING for copying permission.#include "splib.h"#include "TypeId.h"#ifdef SP_NAMESPACEnamespace SP_NAMESPACE {#endifint TypeId::isA(TypeId ti) const{  if (*this == ti)    return 1;  for (const void *const *p = bases_; *p; p++)    if (TypeId((const void *const *)*p).isA(ti))      return 1;  return 0;}int TypeId::canCast(TypeId to, TypeId from) const{  return isA(to) && to.isA(from);}#ifdef SP_NAMESPACE}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?