1) What is binary encapsulation in c++, and does c++ support binary encapsulation?
I did some searching but all that I found was just encapsulation, which roughly is nothing but wrapping of data and methods in a class.
2) So what is the difference between encapsulation and binary encapsulation?
A quote from this text should clear things up:
Whereas C++ does support syntactic encapsulation via its private and protected keywords, the C++ draft standard has no notion of binary encapsulation. This is because the compilation model of C++ requires the client’s compiler to have access to all information regarding object layout in order to instantiate an instance of a class or to make nonvirtual method calls. This includes information about the size and order of the object’s private and protected data members.
To clarify: Syntactic encapsulation is when you use the language syntax to encapsulate. In C++ this would be the private/protected keywords.
I found the text through this thread which has a short explanation of the concept as well.
Edit:
As pointed out below there can exist binary encapsulation in C++. See this wiki page on Opaque pointers for more info.