Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To answer your first question:</p> <ul> <li>Most dynamic languages have their <code>method_missing</code> constructs, PHP has a <a href="http://php.net/manual/en/language.oop5.magic.php" rel="nofollow noreferrer">magic methods</a> (<code>__call</code> and <code>__callStatic</code>) and Python has <code>__getattr__</code>. I think the reason this isn't available in C++ that it goes against the typed nature of C++. Implementing this on a class means that any typos will end up calling this function (at runtime!), which prevents catching these problems at compile time. Mixing C++ with duck typing doesn't seem to be a good idea. </li> <li>C++ tries to be as fast as possible, so first class functions are out of question.</li> <li>AOP. Now this is more interesting, techincally there's nothing that prevents this being added to the C++ standard (apart from the fact that adding another layer of complexity to an already extremly complex standard is might not be a good idea). In fact there are compilers which are able to wave code, <a href="http://www.aspectc.org/" rel="nofollow noreferrer">AspectC++</a> is one of them. A year ago or so it wasn't stable but it looks like since then their managed to release 1.0 with a pretty decent test suite so it might does the job now.</li> </ul> <p>There are a couple of techniques, here's a related question:</p> <p><a href="https://stackoverflow.com/questions/6622290/emulating-clos-before-after-and-around-in-c/6622774">Emulating CLOS :before, :after, and :around in C++</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload