title: How to use a class member function as defualt value
body: <p>I have this class</p>
  
  <pre><code>class InventoryManagement
  {
  public:
      typedef void(InventoryManagement::*Action)(void);
      typedef void(InventoryManagement::*ActionWithReturn)(InventoryItem);
  
      void Initialize(int inventoryQty, int maxQty, ActionWithReturn onAdd = nullptr , Action onMaxQtyReach = nullptr, Action onQtyReset = nullptr, Action onSideChnage = nullptr);
  
      Action getStrategyOnMaxQtyReach();
      Action getStrategyOnQtyReset();
      Action getStrategyOnSideChange();
      ActionWithReturn getOnAdd();
  
  private:
  
      // Private Functions Data members
      ActionWithReturn m_onAdd;
      Action m_OnSideChange;
      Action m_OnQtyReset;
      Action m_OnMaxQtyReach;
  
  
      // Default Function 
      void OnAddDefault(InventoryItem item) { }
      void OnMaxQtyReachDefault() { }
      void OnQtyResetDefault() { }
      void OnSideChangeDefault() { }
  };
  </code></pre>
  
  <p>The function <code>Initialize</code> sets the data members of type <code>Action</code>.
  I created default actions that do noting and I want to pass them as default arguments. If the user doesn't send any function pointer to <code>Initialize</code> then those functions will be set.</p>
  
  <p>The signature of the function is:</p>
  
  <pre><code>void Initialize(int inventoryQty, int maxQty, ActionWithReturn onAdd = nullptr , Action onMaxQtyReach = nullptr, Action onQtyReset = nullptr, Action onSideChnage = nullptr);
  </code></pre>
  
  <p>I tried
  <code>void Initialize(int inventoryQty, int maxQty, ActionWithReturn onAdd = InventoryManagement::OnAddDefault , Action onMaxQtyReach = nullptr, Action onQtyReset = nullptr, Action onSideChnage = nullptr);</code>
  instead of <code>nullptr</code>, but the compiler emitted <em>"Call to non-static member function without an object argument"</em>.</p>