List:MySQL++« Previous MessageNext Message »
From:Chris Frey Date:May 25 2005 7:50pm
Subject:Re: Can you have more than one active mysqlpp::Connection object?
View as plain text  
On Wed, May 25, 2005 at 03:43:54PM -0400, Chris Frey wrote:
> const ColData   operator [] (size_type i) const;
> 
> This returns a temporary, which disappears after that line of code.
> You need to make a copy for yourself.

Replying to myself... ahem. :-)

As an alternative to makeing a copy, you can use "row[1]" everywhere,
instead of saving a pointer.

Note that ColData provides casting conversions, so you can cast that data
to std::string, int, long, etc, and ColData will try to make the conversion
for you.  The temporary will still disappear though, so making your own copy is
likely the most efficient method.

- Chris

Thread
Can you have more than one active mysqlpp::Connection object?Byrial Jensen24 May
  • Re: Can you have more than one active mysqlpp::Connection object?Earl Miles24 May
  • Re: Can you have more than one active mysqlpp::Connection object?Warren Young24 May
    • Re: Can you have more than one active mysqlpp::Connection object?Byrial Jensen25 May
      • Re: Can you have more than one active mysqlpp::Connection object?Earl Miles25 May
        • Re: Can you have more than one active mysqlpp::Connection object?Chris Frey25 May
          • Re: Can you have more than one active mysqlpp::Connection object?Chris Frey25 May
            • Re: Can you have more than one active mysqlpp::Connection object?Earl Miles25 May
          • Re: Can you have more than one active mysqlpp::Connection object?Byrial Jensen25 May
            • Re: Can you have more than one active mysqlpp::Connection object?Warren Young26 May
              • Re: Can you have more than one active mysqlpp::Connection object?Byrial Jensen26 May
                • Re: Can you have more than one active mysqlpp::Connection object?Warren Young26 May