[date_time] Constructor causes syntax error

The latest CVS contains the following code in boost/date_time/date_generator_parser.hpp: date_generator_parser(const date_generator_parser<date_type,charT>* dgp) ------------------------------------------------------------------^ { this->m_element_strings = dgp.m_element_strings; -------------------------------^ } This is a typo, isn't it? Shoudn't this be a copy constructor? Markus

On Thu, 11 Aug 2005 12:58:58 +0200, Markus Schöpflin wrote:
The latest CVS contains the following code in boost/date_time/date_generator_parser.hpp:
date_generator_parser(const date_generator_parser<date_type,charT>* dgp) ------------------------------------------------------------------^ { this->m_element_strings = dgp.m_element_strings; -------------------------------^ }
This is a typo, isn't it? Shoudn't this be a copy constructor?
Yes, it is a typo. It should be an ampersand instead of an asterisk. date_generator_parser(const date_generator_parser<date_type,charT>& dgp) ------------------------------------------------------------------^ Thanks for bringing this to our attention. Bart

Bart wrote:
Yes, it is a typo. It should be an ampersand instead of an asterisk.
date_generator_parser(const date_generator_parser<date_type,charT>& dgp) ------------------------------------------------------------------^
Thanks for bringing this to our attention.
It's present in the current RC as well. Markus

Markus Sch?pflin wrote:
Bart wrote:
Yes, it is a typo. It should be an ampersand instead of an asterisk.
date_generator_parser(const date_generator_parser<date_type,charT>& dgp) ------------------------------------------------------------------^
Thanks for bringing this to our attention.
It's present in the current RC as well.
Presumably it doesn't matter much, since the compiler will generate a copy ctor with the right semantics, so the typo just introduces a constructor that will only cause an error if it's instantiated, which is fairly unlikely. In fact, why is the copy ctor explicitly defined at all? jon

Jonathan Wakely wrote:
Presumably it doesn't matter much, since the compiler will generate a copy ctor with the right semantics, so the typo just introduces a constructor that will only cause an error if it's instantiated, which is fairly unlikely.
Not for Comeau frontends which check the template code. See the latest Tru64/CXX regression results for date_time. Markus

On Thu, 11 Aug 2005 16:52:59 +0100, Jonathan Wakely wrote
Markus Sch?pflin wrote:
Presumably it doesn't matter much, since the compiler will generate a copy ctor with the right semantics, so the typo just introduces a constructor that will only cause an error if it's instantiated, which is fairly unlikely.
In fact, why is the copy ctor explicitly defined at all?
Clearly a bug -- I've removed the function in the CVS version to help compilers that seem to care. Thx, Jeff
participants (5)
-
Bart
-
Jeff Garland
-
Jonathan Wakely
-
Markus Schöpflin
-
Markus Schöpflin