Home > Archive > MySQL PlusPlus > September 2005 > [patch] row::operator(int)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [patch] row::operator(int)
Chris Frey

2005-09-17, 8:23 pm

Here's the int style patch to row.h, for evaluation. It's not as clean
as the template solution, but there is less chance of weird error
messages.

Applies against CVS.

- Chris


Index: lib/row.h
====================
====================
====================
=======
--- lib/row.h (revision 1119)
+++ lib/row.h (working copy)
@@ -130,6 +130,18 @@

/// \brief Get the value of a field given its index.
///
+ /// If the index value is bad, the underlying std::vector is
+ /// supposed to throw an exception, according to the Standard.
+ ///
+ /// This function provides the int overload so row[0] is not
+ /// ambiguous.
+ const ColData operator [](int i) const
+ {
+ return at(i);
+ }
+
+ /// \brief Get the value of a field given its index.
+ ///
/// If the index is out-of-bounds, the underlying vector is supposed
/// to throw an exception according to the C++ Standard. Whether it
/// actually does this is implementation-dependent.


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?uns...sie.nctu.edu.tw

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com