List:MySQL++« Previous MessageNext Message »
From:Matt Dargavel Date:October 7 2006 2:47pm
Subject:Re: mysql++ memory usage
View as plain text  
Alex Burton wrote:
> Warren,
>
> Rather than doing a special case for VC++, could you just use the 
> default constructor for std::ostream and then call init as before ?
> The only change being std::ostream(0) becomes std::ostream()
Unfortunately, there's no default constructor available for ostream in VC++.

> The code in the default constructor for basic_ofstream would be worth 
> a look in the relavent implementations of std c++ library, just do 
> whatever they are doing ?
In VC++ for basic_ofstream they do what Alex initially did and pass a 
pointer to a member variable in. 

Having trawled through the VC++ and gcc std lib source code a bit more, 
I think this might be the better solution (sorry Warren).  Mainly 
because in the _Uninitialised::_NoInit constructor in VC++ it calls 
ios_base::_Addstd(this) whereas, unless you specify a second param of 
true, in the other constructor it doesn't.  Unfortunately, I have no 
idea what _Addstd does, except that it's "special handling for standard 
streams".  Also, taking this approach it's the same across platforms, 
even if it does rely on all implementations doing nothing with the 
pointer you pass in, except for storing it.







Thread
mysqlpp and wchar_t problemgani b. c.2 Oct
  • Re: mysqlpp and wchar_t problemWarren Young2 Oct
    • mysql++ memory usageAlex Burton3 Oct
      • Re: mysql++ memory usageWarren Young4 Oct
      • Re: mysql++ memory usageBill K4 Oct
        • Re: mysql++ memory usageAlex Burton4 Oct
        • Re: mysql++ memory usageWarren Young4 Oct
          • Re: mysql++ memory usageBill K5 Oct
            • Re: mysql++ memory usageWarren Young5 Oct
              • Re: mysql++ memory usageAlex Burton6 Oct
                • Re: mysql++ memory usageAlex Burton6 Oct
                  • RE: mysql++ memory usageMatt Dargavel6 Oct
                    • Re: mysql++ memory usageWarren Young6 Oct
                      • Re: mysql++ memory usageAlex Burton7 Oct
                        • Re: mysql++ memory usageWarren Young7 Oct
                        • Re: mysql++ memory usageMatt Dargavel7 Oct
                          • Re: mysql++ memory usageWarren Young12 Oct
                            • Exporting classesMatt Dargavel19 Oct
                              • Re: Exporting classesWarren Young20 Oct
                                • RE: Exporting classesMatt Dargavel20 Oct
      • Re: mysql++ memory usageCarlos Flores4 Oct
    • Re: mysqlpp and wchar_t problemgani b. c.3 Oct