List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:October 21 2004 9:20pm
Subject:Re: using namespace?
View as plain text  
Sasha Shipka wrote:

> wndGlasila.cc:28: error: `MysqlRow' is not a member of
> type `Gtk::TreeModel'

Namespaces aren't the solution to this problem.  The solution is to 
remove define_short.hh, and then deal with the consequences of that.

This is on the Wishlist.  I suspect it'll break a lot of code, but I 
really don't give a damn on this one.  define_short is one of the worst 
ideas I've seen in a released library.

> So, why don't mysql++ use namespaces instead of
> macros?

The library uses macros in a vain attempt at hiding the MySQL-ness of 
the library behind generic names.  At one point, the maintainers of this 
library thought they'd make it work with other databases, so "Row" makes 
more sense than "MysqlRow", or even Mysql::Row.  That dream is now dead, 
but some of its artifacts are still with us.

Not to deflect your criticism (it's valid), but the fact that you've 
been bitten by this problem indicates that you're probably trying to mix 
GUI and database code in a single module.  You might rethink your 
program's design a bit.  The first time you need to move to a different 
database, you'll thank me.  :)
Thread
using namespace?Sasha Shipka21 Oct
  • Re: using namespace?Chris Frey21 Oct
    • Re: using namespace?Warren Young21 Oct
      • Re: using namespace?Chris Frey22 Oct
        • Re: using namespace?Warren Young22 Oct
          • Re: using namespace?Sasha Shipka22 Oct
  • Re: using namespace?Warren Young21 Oct