Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2008-01-25 11:51:50


Seems there is no standard constructor for local_date_time_base(). Use
the member initializer syntax.

Christian

On Jan 25, 2008 10:55 AM, Fabien CARMAGNAC <fcarmagnac_at_[hidden]> wrote:
>
> Dear all,
>
> I am using a boost::date_time::local_date_time and I have a problem when a
> local_date_time is declared as class member.
>
> Case 1
>
> class toto
> {
> protected:
> boost::local_time::local_date_time tt ;
> public:
> toto(boost::local_time::local_date_time t) : tt(t) {}
> ~toto(){}
> };
> => compil ok
> ===========
> Case 2 (using '=' operator)
> class toto
> {
> protected:
> boost::local_time::local_date_time tt ;
> public:
> toto(boost::local_time::local_date_time t) {
> tt=t;
> }
> ~toto(){}
> };
> => does not compiles !
> Errors:
>
> make all
> Building file: ../src/toto.cpp
> Invoking: GCC C++ Compiler
> g++ -I"/home/fabien/dev/eclipse_workspace" -O0 -g3 -Wall -c
> -fmessage-length=0 -MMD -MP -MF"src/toto.d" -MT"src/toto.d" -o"src/toto.o"
> "../src/toto.cpp"
> ../src/toto.cpp: In constructor
> 'toto::toto(boost::local_time::local_date_time)':
> ../src/toto.cpp:16: error: no matching function for call to
> 'boost::local_time::local_date_time_base<boost::posix_time::ptime,
> boost::date_time::time_zone_base<boost::posix_time::ptime, char>
> >::local_date_time_base()'
> /usr/include/boost/date_time/local_time/local_date_time.hpp:218: note:
> candidates are: boost::local_time::local_date_time_base<utc_time_,
> tz_type>::local_date_time_base(boost::date_time::special_values,
> boost::shared_ptr<U>) [with utc_time_ = boost::posix_time::ptime, tz_type =
> boost::date_time::time_zone_base<boost::posix_time::ptime, char>]
> /usr/include/boost/date_time/local_time/local_date_time.hpp:211: note:
> boost::local_time::local_date_time_base<utc_time_,
> tz_type>::local_date_time_base(const
> boost::local_time::local_date_time_base<utc_time_, tz_type>&) [with
> utc_time_ = boost::posix_time::ptime, tz_type =
> boost::date_time::time_zone_base<boost::posix_time::ptime, char>]
> /usr/include/boost/date_time/local_time/local_date_time.hpp:141: note:
> boost::local_time::local_date_time_base<utc_time_,
> tz_type>::local_date_time_base(typename utc_time_::date_type, typename
> utc_time_::time_duration_type, boost::shared_ptr<U>,
> boost::local_time::local_date_time_base<utc_time_,
> tz_type>::DST_CALC_OPTIONS) [with utc_time_ = boost::posix_time::ptime,
> tz_type = boost::date_time::time_zone_base<boost::posix_time::ptime, char>]
> /usr/include/boost/date_time/local_time/local_date_time.hpp:100: note:
> boost::local_time::local_date_time_base<utc_time_,
> tz_type>::local_date_time_base(typename utc_time_::date_type, typename
> utc_time_::time_duration_type, boost::shared_ptr<U>, bool) [with utc_time_ =
> boost::posix_time::ptime, tz_type =
> boost::date_time::time_zone_base<boost::posix_time::ptime, char>]
> /usr/include/boost/date_time/local_time/local_date_time.hpp:79: note:
> boost::local_time::local_date_time_base<utc_time_,
> tz_type>::local_date_time_base(utc_time_, boost::shared_ptr<U>) [with
> utc_time_ = boost::posix_time::ptime, tz_type =
> boost::date_time::time_zone_base<boost::posix_time::ptime, char>]
> make: *** [src/toto.o] Error 1
>
> I am using:
> Linux 2.6.23.8-34.fc7
> boost-1.33.1-15.fc7
> boost-devel-1.33.1-15.fc7
> g++ (GCC) 4.1.2 20070925 (Red Hat 4.1.2-27)
>
> Thanks for your help !
> Regards,
>
> Fabien CARMAGNAC
>
>
>
> ________________________________
> Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net