Automatic inline : inline « Class « C++






Automatic inline

Automatic inline
 

#include <iostream>
using namespace std;

class myclass {
  int a, b;
public:
  // automatic inline
  void init(int i, int j) { 
      a = i; 
      b = j; 
  }
  void show() { 
      cout << a << " " << b << endl; 
  }
};

int main() {
  myclass x;

  x.init(10, 20);
  x.show();

  return 0;
}

           
         
  








Related examples in the same category

1.Inline functions may be class member functionsInline functions may be class member functions
2.Create an inline function.Create an inline function.
3.Use inline to make this program more efficient
4.Creating Inline Functions Inside a Class
5.Inline function that calculates the volume of a sphere