Why do I have to access template base class members through the this pointer?

Short answer: in order to make x a dependent name, so that lookup is deferred until the template parameter is known. Long answer: when a compiler sees a template, it is supposed to perform certain checks immediately, without seeing the template parameter. Others are deferred until the parameter is known. It’s called two-phase compilation, and … Read more

C++ pointer decleration

Well… Double_node<Type *> *ptr = stack.list.head(); is declaring a variable ptr which is of type pointer (thanks to the *) to Double_node<Type *> while Double_node<TType *> ptr = stack.list.head(); is declaring a variable ptr which is a Double_node<TType *>. The latter is not a pointer.

PHP: What’s the speed difference “template” vs “quote”? [duplicate]

Let’s find out: <?php ob_start(); $a = 0; $time1 = microtime(true); for ($i = 0; $i < 100000; $i++) { echo “<html><body>$a</body></html>”; } $time2 = microtime(true); for ($i = 0; $i < 100000; $i++) { ?> <html><body><?php echo $a; ?></body></html> <?php } $time3 = microtime(true); ob_end_clean(); echo ‘Just echo: ‘ . ($time2 – $time1) . … Read more