Created
January 11, 2015 16:37
-
-
Save maraigue/d9a40a3028a4ae8689b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Hoge{ | |
const int v; | |
public: | |
Hoge(int x) : v(x * 5) {} // 問題なく動作 | |
//Hoge(int x) { v = x * 5; } // 不可 | |
int value(){ return v; } | |
}; | |
int main(void){ | |
Hoge h(8); | |
std::cout << h.value() << std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment