Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #7724

Re: in g++(invalid use of incomplete type)

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: in g++(invalid use of incomplete type)
Date 2011-07-11 20:54 +1200
Message-ID <97vs3fF61iU1@mid.individual.net> (permalink)
References <e56f2431-3294-45f1-a5c5-7c0cf172fd96@k19g2000prn.googlegroups.com> <9216c5aa-78f7-43cd-9957-dea63f1b5a84@34g2000pru.googlegroups.com>

Show all headers | View raw


On 07/11/11 07:31 PM, eric wrote:
>
> -----------------------------------------------------the program I
> used to compile is-----------------------
> // Example 5-4 formatting a datetime string
> #include<iostream>
> #include<cstdlib>
> #include<ctime>
> #include<cstring>
> #include<string>
> #include<stdexcept>
> #include<iterator>
> #include<sstream>
>
> using namespace std;
>
> ostream&  formatDatetime(ostream&  out, const tm&  t, const char* fmt) {
>    const time_put<char>&  dateWriter = use_facet<time_put<char>
>> (out.getloc());

In which standard header is time_put declared?  Check for balance of < 
and >.

>    int n = strlen(fmt);
>    if (dateWriter.put(out, out, ' ',&t, fmt, fmt + n).failed()) {
>       throw runtime_error("failure to format date time");
>    }
>    return out;
>   }
>
> string dateTimeToString(const tm&  t, const char* format) {
>     stringstream s;
>     formatDateTime(s, t, format);

Names are case sensitive!

>     return s.str();
>   }


-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

in g++(invalid use of incomplete type) eric <cneric12lin0@gmail.com> - 2011-07-10 23:32 -0700
  Re: in g++(invalid use of incomplete type) eric <cneric12lin0@gmail.com> - 2011-07-11 00:31 -0700
    Re: in g++(invalid use of incomplete type) Michael DOUBEZ <michael.doubez@free.fr> - 2011-07-11 01:54 -0700
    Re: in g++(invalid use of incomplete type) Ian Collins <ian-news@hotmail.com> - 2011-07-11 20:54 +1200

csiph-web