string constructor is implemented with less temporary objects created