Below are lines from "the c++ programming language"
template<class T > T sqrt(T );
template<class T > complex<T> sqrt(complex<T>);
double sqrt(double);
void f(complex<double> z )
{
s q r t (2 ); // sqrt<int>(int)
sqrt(2.0) ; // sqrt(double)
sqrt(z) ; // sqrt<double>(complex<double>)
}
I dont understand why sqrt(z) ; calls sqrt<double>...
I ran into this supposed interview of Bjarne Stroustrup, the inventor of C++.
http://artlung.com/smorgasborg/Invention_of_Cplusplus.shtml
Stroustrup: Well, it's been long enough, now, and I believe most people have figured out for themselves that C++ is a waste of time but, I must say, it's taken them a lot longer than I thought it ...
I'm doing the exercises in Stroustrup's new book "Programming Principles and Practice Using C++" and was wondering if anyone on SO has done them and is willing to share the knowledge? Specifically about the calculator that's developed in Chap 6 and 7. Eg the questions about adding the ! operator and sqrt(), pow() etc. I have done these b...
This is a question from the most recent version of Stroustrup's "The C++ Programming Language".
I've been mulling this over in my head for the past couple days.
The only thing I can come up with, (and this is probably incorrect) is something like this:
int* f(int n) {
int* a = &a - n * sizeof(int*);
return a;
}
My intent is to g...
I am currently reading Stroustrup's book "Design and Evolution of C++" and it turns out that he was not the one who developed C++. When I hear someone saying "Bjarne Stroustrup developed C++ blah-blah-blah", I always feel it is very unfair to these guys who worked with BS - I mean Jonathan Shopiro, Andrew Koenig, Stan Lippman, Stefan Dew...
In Stroustrup's The C++ Programming Language: Special Edition (3rd Ed), Stroustrup writes that the declaration and initialization of variables in the conditionals of control statements is not only allowed, but encouraged. He writes that he encourages it because it reduces the scope of the variables to only the scope that they are requir...
Simple question. Many consider "The C++ Programming Language" by Bjarne Stroustrup to be the de facto for learning advanced C++. What is the equivilent book for learning C# to the most advanced level?
...
Has Bjarne Stroustrup made a comment about a language that isnt C or C++(0x)?
I saw his comments about C++ CLI but i havent seen him mention anything about another language. Such as D, python, javascript, OCaml, haskel, etc.
If so do you have a link?
(note: omg bjarne-stroustrup has his own tag!)
...