conversion-operator
Acceptable programming practice - conversion and upcasting
Is the following acceptable programming practice: class TestA { prote开发者_开发技巧cted: int A; public:[详细]
2023-04-10 16:24 分类:问答C++ conversion const pass-by-reference
Given a template pass-by-reference conversion/type-cast operator (without const) is possible: class TestA[详细]
2023-04-09 08:53 分类:问答C++ Conversion operator for converting to function pointer
I\'m been grinding my head against an idea that is simple enough in my head, but I can\'t figure out how to implement in C++.[详细]
2023-03-22 01:16 分类:问答sequence of conversions with contsructor-type conversions and conversion operators
I have read that a standard conversion can precede or follow a conversion implemented by a conversion operator or a contructor type conversion. On the other hand,[详细]
2023-02-27 02:55 分类:问答What is an "operator int" function?
What is the \"operator int\" function below? What does it do? class INT { int a; public: INT(int ix = 0) { a = ix;[详细]
2023-01-18 10:44 分类:问答Const operator overloading problems in C++
I\'m having trouble with overloading operator() with a const version: #include <iostream> #include <vector>[详细]
2022-12-23 07:41 分类:问答Can you catch an exception by the type of a conversion operator?
I don\'t know how to phrase the question very well in a short subject line, so let me try a longer explanation.Suppose I have these exception classes:[详细]
2022-12-21 14:37 分类:问答STL: how to overload operator= for <vector>?
There\'s simple example: #include <vector> int main() { vector<int> veci; vector<double> vecd;[详细]
2022-12-18 19:32 分类:问答conversion operator as standalone function
Why does C++ require that user-defined conversion operator can only be non-static member? Why is it not allowed to use standalone functions as for other unary operators开发者_StackOverflow?[详细]
2022-12-18 10:15 分类:问答C++: Overloading operator=
Okay so I have a class that has \'weak typing\' I.E. it can store many different types defined as: #include <string>[详细]
2022-12-17 01:23 分类:问答