How to initialize the exposed type of class member variable at creation time?