Because the class would be infinite in size.
(This is done language-wise by specifying you can’t have incomplete types as members, only reference or pointers to them, and that A
is an incomplete type until the end of the class definition.)
More Related Contents:
- C++ Reading an unknown number of integers to cin and outputting the sum
- How do you transform a number to its sign? [closed]
- When to include quotation marks for cout
- OpenGL – vertex normals in OBJ
- When to use extern in C++
- Why is address of char data not displayed?
- How to print function pointers with cout?
- “Undefined reference to” template class constructor [duplicate]
- What is the meaning of the term “free function” in C++?
- How is std::string implemented?
- Screen recorder [closed]
- C++ – Why is boost::hash_combine the best way to combine hash-values?
- Comparing arrays for equality in C++
- c++ array assignment of multiple values
- In C++, what categories (lvalue, rvalue, xvalue, etc.) can expressions that produce temporaries of class type fall into?
- Operator Overloading in C++ as int + obj
- How can I check if a type is an instantiation of a given class template? [duplicate]
- How to navigate through a vector using iterators? (C++)
- what does __declspec(dllimport) really mean?
- Compare std::wstring and std::string
- Is it possible to declare constexpr class in a header and define it in a separate .cpp file?
- Using SFINAE to check for global operator
- Tackling Class Imbalance: scaling contribution to loss and sgd
- Ncurses and Qt Interoperability
- How to build boost Version 1.58.0 using Visual Studio 2015 (Enterprise)
- Equivalent to cvSetImageROI in the OpenCV C++ interface
- how to add zlib to an existing qt installation
- Creating JSON arrays in Boost using Property Trees
- How to test whether class B is derived from template family of classes
- What’s the difference between istringstream, ostringstream and stringstream? / Why not use stringstream in every case?