bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Datetime suggestion.


From: David Sugar
Subject: Re: Datetime suggestion.
Date: Thu, 28 Aug 2003 12:03:43 -0400 (EDT)

Since we don't expect to write back to that string pointer, yes, it
probably should be const anyway, and there may be others that is true for
as well.

Andrey Kulikov said:
> Hi All!
>
> OS: Windows XP
> Compiller: Visual Studio 2003
>
> Problem: Class ost::Datetime has a constructor
>
> Datetime(char *str, size_t size = 0);
>
> It's make not possible to use it like this:
>
> string s="10/10/1971 12:34";
> Datetime dt = Datetime(s.c_str());
>
> because string::c_str() return const char*.
>
> Solution: Declare the ost::Datetime's constructor like this:
>
>
> Datetime(const char *str, size_t size = 0);
>
>
>
> --
> Best regards,
>  Andrey
>
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp






reply via email to

[Prev in Thread] Current Thread [Next in Thread]