How to embed data within an executable?
Dicebot
public at dicebot.lv
Sun Feb 2 13:06:31 PST 2014
On Sunday, 2 February 2014 at 20:45:45 UTC, Gary Willoughby wrote:
> On Sunday, 2 February 2014 at 19:57:11 UTC, Dicebot wrote:
>> On Sunday, 2 February 2014 at 17:45:37 UTC, Gary Willoughby
>> wrote:
>>> enum embed = getData();
>>> }
>>
>> I am pretty sure you want immutable variable here, not enum.
>> Latter is placement constant.
>
> I thought this was an idiomatic way to write eponymous
> templates? Manifest constants by their nature can not be
> mutated.
>
> http://dlang.org/enum.html
At first glance I had impression that you intend to use it as a
mixin. As a simple eponymous shortcut it will work, nevermind :)
More information about the Digitalmars-d-learn
mailing list