Tag:base class

  • Const_ cast,static_ cast, dynamic_ cast, reinterpret_ cast


    const_ Cast: used to convert const variables to non const variables int n = 5; int *k1 = const_ Cast (& n); // pointer *k1 = 1; int &k2 = const_ Cast (n); // reference k2 = 2; const int a = 10; int* b = const_cast(&a); *B = 11; // the attribute of pointer […]

  • Python exception handling


    Distinguish exception from syntax error When writing Python programs, errors are often reported. There are usually two kinds of errors: Syntax error:Some grammatical errors are exceptions Exception syntax error Syntax error, also known as parsing error, is one of the most common errors In [1]: while True print(‘Hello!’) File “<ipython-input-1-5c66e4fd0ae9>”, line 1 while True print(‘Hello!’) […]

  • C + + basic knowledge conclusion


    On constant member functions: Const double function() and double function() const; many people may confuse them, but they are not exactly the same. The former is to ensure that the returned value is the constant (Note: variable cannot be changed), the latter is to require that your function does not involve changing the value of […]

  • Interview Series C + + object layout


    We all know that C + + polymorphism is realized through the virtual function table. What is the specific type? Do you know? At the beginning, several questions are still raised What is the layout of common class objects? What is the layout of class objects with virtual functions? What is the layout of class […]

  • Study day 51


    C++ Base class pointer, derived class pointer A parent class pointer can call a member function of a parent class, a parent class pointer cannot call a member function of a child class That is to say, the pointer and type of the same parameter function with the same name of the parent class and […]

  • Study day 53


    C++ What is RTTI Runtime type recognition, enabling programs to use pointers or references to base classes to check the actual derived types of the objects that the pointers or references refer to Through dynamic_ Cast operator can change base class (parent class)Pointer or referenceSafe conversion to a derived class (subclass) pointer or reference TypeID […]

  • Study day 54


    C++ Subclass object model Derived classes contain multiple components(multiple sub objects) the contents of multiple objects need not be related It contains the member variables defined by the subclass itself, the sub objects of the member functions The subclass inherits the subobjects of the base class, and the subobjects contain the member variables and member […]

  • Type parameter constraints of C # generics


    Common constraints Constraints tell the compiler what a type parameter must have. A type parameter can be any type without any constraints. The compiler can only assume System.Object Is the ultimate base class of any. Net type. If the client code uses a type that does not satisfy the constraint, the compiler issues an error. […]

  • Study day 58


    C++ Inherited constructors A class only inherits the constructor, default, copy and move constructors of its direct base class (parent class), which cannot be directly inherited Using makes a name visible in the current scope class a { public: a(int a1,int a2,int a3){} }; class b :public a { public: Using a:: A // inherits […]

  • In those years, we saw Java Server chaos


    Reading guide Charles Dickens wrote in a tale of two cities: “this is the best time and the worst time.” With the rapid development of mobile Internet, many new opportunities have emerged, and many entrepreneurs are waiting for the opportunity. With the intensification of industry competition, Internet dividends gradually disappear, and many start-up companies are […]

  • Secondary packaging of flutter Dio


    catalog: Diomanager: DIO helper classNwmethod: request method, get, post, etcNwapi: Everybody knowsEntityfactory: JSON transforms auxiliary factory to tBaseentity < T >: data base class, the returned parameters are {“code”: 0, “message”: “,” data “: {}}Baselistentity < T >: data base class 2, the returned parameters are {“code”: 0, “message”: “,” data “: []}Errortentity: request error […]

  • Sagit.Framework Introduction to for IOS development framework 10: basic usage of stmodelbase and sthttpmodel entity base classes


    preface: This article introduces the common usage of model base class stmodelbase and stmodel in SAGIT framework. Stmodelbase: the base class of all entities, from which self-defined entities inherit. Stmodel: internally pre implemented entity class used for the results returned by the sthttp network request. 1. Introduction to model related entities in the framework: Stmodel […]