Bug 13806 – std.bitmanip.BitArray -- use of methods named init() messes up templates
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-01T21:06:00Z
Last change time
2017-07-20T15:34:05Z
Keywords
pull
Assigned to
nobody
Creator
erikas.aubade
Comments
Comment #0 by erikas.aubade — 2014-12-01T21:06:05Z
It seems to be pretty common and accepted practice to use the static init field to get default values of an arbitrary templated type--however this pattern will fail hard on types like BitArray that have methods name init(), and no overloads that can be called without parameters.
It'd make life a lot easier if these methods could be renamed to something like initialize().
Comment #1 by hsteoh — 2014-12-16T15:54:20Z
IMO, proper ctors should be used instead of init(), since that is essentially what they do.