fork download
  1. #include <vector>
  2.  
  3. struct NoDefault
  4. {
  5. NoDefault(float f);
  6. };
  7.  
  8. int main()
  9. {
  10. std::vector<NoDefault> arr(5);
  11. return 0;
  12. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor 'std::vector<_Tp, _Alloc>::vector(std::vector::size_type, const value_type&, const allocator_type&) [with _Tp = NoDefault, _Alloc = std::allocator<NoDefault>, std::vector::size_type = unsigned int, value_type = NoDefault, allocator_type = std::allocator<NoDefault>]':
prog.cpp:10:33: error: no matching function for call to 'NoDefault::NoDefault()'
prog.cpp:5:3: note: candidates are: NoDefault::NoDefault(float)
prog.cpp:4:1: note:                 NoDefault::NoDefault(const NoDefault&)
stdout
Standard output is empty