我这么做的时候..。
auto t = typeid(float);
..。我得到:
错误C2248 'type_info::type_info':无法访问类'type_info‘中声明的私有成员
当然,我知道我能做到.
auto t = typeid(float).name();
但是,如果我想使用第一个表达式,我将如何修改type_info类并使用friend来实现我的目标?有什么建议吗?
我在Visual Studio2008中得到了以下错误: error C2248:'Town::Town‘:无法访问在类'Town’中声明的私有成员。看起来构造函数不能访问它自己类的成员。知道是怎么回事吗?代码如下:
我有这个:
template<class T> class Tree{...}
还有这个类:
class Town{
Town(int number):number(number){};
...
private:
int number;
};
它在这个类中使用:
class Country{
public:
Statu
我正在尝试为Windows服务创建一个基类。在创建时,这将自动创建:
public partial class Service1 : ServiceBase
{
public class Base //added this to become a Base class
{
protected override void OnStart(string[] args)//generated code for Service
{
//a bunch of code here that I create