Search:

Type: Posts; User: DrPiratePhD

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    1,883

    The purpose of default arguments is to avoid some...

    The purpose of default arguments is to avoid some tedious coding.
    Let's say for example that you are writing the function:

    double logarithm(double x, double base)
    Let's assume in your code, you...
  2. I understand it can be annoying to write two...

    I understand it can be annoying to write two functions which are practically identical.
    However, C++ evaluates expressions with operators following the C++ order of operations, and
    the rule for...
  3. Sometimes, the object which you wish to pass to...

    Sometimes, the object which you wish to pass to the function is very expensive to copy.
    What if the string passed to send_me_a_string_copy was the Declaration of Independence or something...
  4. It certainly is different, but it has definitely...

    It certainly is different, but it has definitely been done before. The tree-method of a math-function (like the one posted by
    hk_mp5kpdw) is a very effective form of prefix notation (+ 2 2 with the...
  5. It's not that important really. I was just...

    It's not that important really. I was just working on a windows API wrapper class. I wanted a simple base class encapsulating class registration and window creation. Upon inheriting from the base...
  6. Help deducing the derived class inside a base class

    Hi!

    In my program, I've been wanting to determine the the derived type of a base class. So far, this seems to work fine:


    class BaseClass
    {
    public:
    template<class derived>
    void...
Results 1 to 6 of 7