Created
November 1, 2013 09:03
-
-
Save ncaq/7262765 to your computer and use it in GitHub Desktop.
このコードはエラーとなる.
ならば,コンストラクタは,mutable版とimmutable版の2つを定義するしか,mutableとimmutableに対応する方法はない?
対応できるのに,そういうことをするのはスマートじゃないと思うのですが
This file contains hidden or 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
class A | |
{ | |
this()const | |
{ | |
a_ = 0; | |
} | |
private | |
{ | |
int a_; | |
} | |
} | |
void main() | |
{ | |
immutable a = new immutable(A)(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment