--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+unsubscribe@isocpp.org.
To post to this group, send email to std-dis...@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.
Well, What Bjarne meant (in my opinion) is that when the compiler (or rather the preprocessor) encounters the line `#include <cmath>` in a .hpp or .cpp file, it may just use it as an indication that the header/cpp file is going to use the math library and thus the compiler allows it to use the built-in mathematical function (without even reading any header file at all). Bjarne is referring to such an indication as switch (a compiler-switch).. and there does not have to exist any file with name `cmath` and the compiler, thus, does not have to read any file at all.
On Fri, Jan 12, 2018 at 10:22 PM, <sachin...@gmail.com> wrote:
Hello,In chapter 9 of C++ programming book by Bjarne Stroustrup, I have come across a statement"An implementation is allowed to take advantage of knwoledge o the standard library definition to optimize the standard library implementation and the way standard headers are handled. For example, an implementation might have knowledge of the standard math library built in and treat #include <cmath> as a switch that makes the standard math functions available without reading any file"I couldn't understand how <cmath> can be used as switch and standard math functions be made available without reading cmath header?Regards,Sachin
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussio...@isocpp.org.
Thanks Nawaz. Now I understand this. So you are saying we can explicitly write the declarations of standard headers based on the switch instead of depending on the cmath file.