On Friday, 7 June 2013 at 16:14:25 UTC, Ali Çehreli wrote:
But it is too heavy-handed. Your problem exposes a real
weakness. Other...
Well, its not *that* heavy.
// Inside Display class.
auto display = alloc!Display;
display.__ctor(name);
Where alloc(T) is a bigger part of the original emplac
tldr; I had the crazy idea of mixing-in a specialization of emplace but
failed probably because mixin does not respect template constraints.
On 06/07/2013 06:50 AM, develop32 wrote:
> Nevermind, problem was not worth the question. I just copied code from
> Phobos std.conv.emplace and placed it
Nevermind, problem was not worth the question. I just copied code
from Phobos std.conv.emplace and placed it directly in my code,
it works since it is in the same module as the private
constructor.
In a project I'm working on there are classes that are available
publicly but I want to disable their construction outside of
their modules.
class Display
{
const string name;
private this(string name)
{
this.name = name;
}
static Display[] all()
{
// Returns all