由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 再问一下
相关主题
question regarding const functionC++要是有null object就好了
An object of A automatically converted to an object of B.c++ operator overloading question
could anybody please tell me what " while(cin) {...}" means?请问一个implicit conversion的问题(C++)
问题[合集] question on item15 in Effective C++
小问题which func will be called?
*(&b1)=b编译不过,b1=b可以,区别是?发现一个有趣的现象。
dynamic_cast operator in C++Swift到底怎么样?有没有前途?
问两个问题,C++[合集] C++ question -- how to save objects
相关话题的讨论汇总
话题: operator话题: object话题: class话题: c++话题: converting
进入Programming版参与讨论
1 (共1页)
N***m
发帖数: 4460
1
in effective c++, there is an example:
class A{};
class B {
public:
operator A() const;
};
according to the book, the operator A() in B plays the role of
converting B object to A object. How to understand this?
z****e
发帖数: 2024
2
read an introductory C++ book.
z****e
发帖数: 2024
3
btw, it is also implicit or "automatically", and there is no way to prevent
this implicit conversion from happening.
N***m
发帖数: 4460
4
忽然明白了,呵呵

prevent

【在 z****e 的大作中提到】
: btw, it is also implicit or "automatically", and there is no way to prevent
: this implicit conversion from happening.

1 (共1页)
进入Programming版参与讨论
相关主题
[合集] C++ question -- how to save objects小问题
问问开发ios的,有用C++来组织代码的么?*(&b1)=b编译不过,b1=b可以,区别是?
C, C++, Java, C#, Objective-C,dynamic_cast operator in C++
[C++] 入门级问题 increment and decrement operators问两个问题,C++
question regarding const functionC++要是有null object就好了
An object of A automatically converted to an object of B.c++ operator overloading question
could anybody please tell me what " while(cin) {...}" means?请问一个implicit conversion的问题(C++)
问题[合集] question on item15 in Effective C++
相关话题的讨论汇总
话题: operator话题: object话题: class话题: c++话题: converting