On Sunday, 29 November 2015 at 15:06:49 UTC, Andrei Alexandrescu wrote:
Thanks all. I'll go with the factory function. -- Andrei

As Timon suggested, I'd encourage you to go for a free factory function named after the container like RedBlackTree does with redBlackTree rather than having a static factory function, since it's less verbose and allows for type inference, though there's no reason why we couldn't have both:

auto c1 = MyCollection!int.make(1, 2, 3);
auto c2 = myCollection!int(1, 2, 3);
auto c3 = myCollection(1, 2, 3);

Regardless, it's better to avoid static opCall.

- Jonathan M Davis

Reply via email to