由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - conversion(c++)
相关主题
请问一个implicit conversion的问题(C++)C++ string to int conversion
C++隐式类型转换的规则?Question about type conversion (转载)
float -> double, double -> long double (C++)How solid it is: c++/c# call Matlab library
关于standard conversion in C++vb 6 to vb.net upgrade question
tempalte as the overloaded conversion operatorfor conversion from string to char*
const_reverse_iterator和reverse_iterator有什么区别? (转载)怎么搞的?
小问题[合集] 又学了一招
C++ Q02:pointer to function
相关话题的讨论汇总
话题: c++话题: int话题: operator话题: conversion话题: possible
进入Programming版参与讨论
1 (共1页)
g***e
发帖数: 577
1
Consider two possible interpreations of the following case
class x{
...
x(int);
friend x operator+ (x,x){...}
operator int(){...}
};
now in code
x y,z; ...some assignment afterwards...
y=z+2;
question: two possible conversions: z to int, then +2 ,then to x.
another way:2 to x then + z.
is this case allowable in C++ syntax?
1 (共1页)
进入Programming版参与讨论
相关主题
pointer to functiontempalte as the overloaded conversion operator
0 < -1 ? A c++ questionconst_reverse_iterator和reverse_iterator有什么区别? (转载)
[合集] dynamic languages 怎样更高地抽象?小问题
真是奇了怪了,VC编译器问题?C++ Q02:
请问一个implicit conversion的问题(C++)C++ string to int conversion
C++隐式类型转换的规则?Question about type conversion (转载)
float -> double, double -> long double (C++)How solid it is: c++/c# call Matlab library
关于standard conversion in C++vb 6 to vb.net upgrade question
相关话题的讨论汇总
话题: c++话题: int话题: operator话题: conversion话题: possible