The pair container is a simple container defined in header consisting of two data elements or objects.
Why without using the header file also we are able to use the pair container and no error is coming.
The pair container is a simple container defined in header consisting of two data elements or objects.
Why without using the header file also we are able to use the pair container and no error is coming.
Hi tushar
This is because implementation of classes, functions or templates are sometimes also included in other header files. like in this case pair implementation is included in iostream.
But you should never rely on that fact. You should always use corresponding header file.
Hope it helps
Mark reolved if satisfied
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.