language: C++ 4.7.2 (gcc-4.7.2)
date: 850 days 14 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
 
using namespace std;
 
class MyClass
{
  private:
    int * a;
    int b;
  public:
    MyClass() { a = new int; }
    ~MyClass() { delete a; }
 
    int & geta(void) const { return *a; } // good?
    const int & getb(void) const { return b; }  // obviously bad
};
 
int main() {
        return 0;
}