记录详情

Compile Error

/in/foo.cc: In constructor 'Package::Package(Person, Person, double, double)':
/in/foo.cc:33:9: warning: 'Package::recip' will be initialized after [-Wreorder]
  Person recip;
         ^~~~~
/in/foo.cc:30:9: warning:   'double Package::weight' [-Wreorder]
  double weight;
         ^~~~~~
/in/foo.cc:82:1: warning:   when initialized here [-Wreorder]
 Package::Package(Person a,Person b,double w, double p) 
 ^~~~~~~
/in/foo.cc: In constructor 'TwoDayPackage::TwoDayPackage(Package, double)':
/in/foo.cc:40:10: warning: 'TwoDayPackage::package' will be initialized after [-Wreorder]
  Package package;
          ^~~~~~~
/in/foo.cc:39:9: warning:   'double TwoDayPackage::flatFee' [-Wreorder]
  double flatFee;
         ^~~~~~~
/in/foo.cc:87:1: warning:   when initialized here [-Wreorder]
 TwoDayPackage::TwoDayPackage(Package lo, double fee)
 ^~~~~~~~~~~~~
/in/foo.cc:88:28: error: no matching function for call to 'Package::Package()'
  : package(lo), flatFee(fee)
                            ^
/in/foo.cc:82:1: note: candidate: Package::Package(Person, Person, double, double)
 Package::Package(Person a,Person b,double w, double p) 
 ^~~~~~~
/in/foo.cc:82:1: note:   candidate expects 4 arguments, 0 provided
/in/foo.cc:18:7: note: candidate: Package::Package(const Package&)
 class Package
       ^~~~~~~
/in/foo.cc:18:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc:18:7: note: candidate: Package::Package(Package&&)
/in/foo.cc:18:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc: In constructor 'OvernightPackage::OvernightPackage(Package, double)':
/in/foo.cc:92:57: error: no matching function for call to 'Package::Package()'
 OvernightPackage::OvernightPackage(Package lp, double pl)
                                                         ^
/in/foo.cc:82:1: note: candidate: Package::Package(Person, Person, double, double)
 Package::Package(Person a,Person b,double w, double p) 
 ^~~~~~~
/in/foo.cc:82:1: note:   candidate expects 4 arguments, 0 provided
/in/foo.cc:18:7: note: candidate: Package::Package(const Package&)
 class Package
       ^~~~~~~
/in/foo.cc:18:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc:18:7: note: candidate: Package::Package(Package&&)
/in/foo.cc:18:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc:92:57: error: no matching function for call to 'Package::Package()'
 OvernightPackage::OvernightPackage(Package lp, double pl)
                                                         ^
/in/foo.cc:82:1: note: candidate: Package::Package(Person, Person, double, double)
 Package::Package(Person a,Person b,double w, double p) 
 ^~~~~~~
/in/foo.cc:82:1: note:   candidate expects 4 arguments, 0 provided
/in/foo.cc:18:7: note: candidate: Package::Package(const Package&)
 class Package
       ^~~~~~~
/in/foo.cc:18:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc:18:7: note: candidate: Package::Package(Package&&)
/in/foo.cc:18:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc: In function 'int main()':
/in/foo.cc:110:44: error: 'Package::Package(Person, Person, double, double)' is private within this context
  Package p(sender, recipient, weight, price);
                                            ^
/in/foo.cc:82:1: note: declared private here
 Package::Package(Person a,Person b,double w, double p) 
 ^~~~~~~

信息

递交者
类型
递交
题目
P1005 11.9 Package_Inheritance
语言
C++
递交时间
2020-03-20 14:19:19
评测时间
2020-03-20 14:19:19
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes