我知道在创建类的对象时,构造函数将构建该对象。说我有这两类: class Vehicle {
public int a = func();
public int func() {
System.out.println("9");
return 9;
}
}
class Car extends Vehicle {
public
代码: struct A
{
private:
A() = default; // Version 1.
};
struct B : public A
{};
struct C
{
private:
C() {}; // Version 2.
};
struct D : public C
{};
int main()
{
struct B {
B() {}
B(int i) {}
};
struct D : B {
using B::B; // <--- new C++11 feature
};
D d1; // ok
D d2(3); // ok
现在,如果我加struct D体内一个新的构造,如: struct D : B {
using B::B;
我这两次发生在我的代码, 我不知道为什么它的抱怨 我有一个头文件“Scene.h”: #pragma once
#include <iostream>
#include <string>
#include "Image.h"
#include "InteractiveObject.h"
using namespace std;
class Scene
{