Re: [Boost-users] fatal error C1001 with visual studio 8, boost 1.34, BOOST_AUTO() macro
----- Original Message ---- From: Arkadiy Vertleyb
To: boost-users@lists.boost.org Sent: Thursday, May 17, 2007 8:39:19 PM Subject: Re: [Boost-users] fatal error C1001 with visual studio 8, boost 1.34, BOOST_AUTO() macro "Trigve Siver"
wrote --- typedef BOOST_TYPEOF(T.exec("SELECT 1")) type; // OK type rs; // fatal error ---
So, it seems to be able to deduce the type, but can't use it? I've never seen anything like this... Is it possible to get the name of the type:
#include
cout << typeid(type).name(); or is it also "fatal error"?
std::cout << typeid(type).name(); // fatal error
Also, if you define your own free function returning the same type, with no parameters, can BOOST_AUTO handle it? With one parameter? A member function with zero or one parameters? with zero or one paramters it works ok
--- class A { public: pqxx::result test(int a) { return pqxx::result(); } pqxx::result test1(void) { return pqxx::result(); } }; pqxx::result test(void) { return pqxx::result(); } pqxx::result test1(void) { return pqxx::result(); } int main(int argc, char* argv[]) { pqxx::connection connection("host=..."); pqxx::nontransaction T(connection, "GetCustomer"); // typedef BOOST_TYPEOF(T.exec("SELECT 1")) type; // OK BOOST_AUTO(rs, test()); // OK BOOST_AUTO(rs, test1()); // ok A a; BOOST_AUTO(rs, a.test(1)); // OK BOOST_AUTO(rs, a.test1()); // ok ... } ---
What exact version of the compiler are you using? Is it Microsoft Visual C++ 2005?
Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) Microsoft .NET Framework Version 2.0.50727 Installed Edition: Professional Microsoft Visual Basic 2005 77626-009-1424494-41887 Microsoft Visual Basic 2005 Microsoft Visual C# 2005 77626-009-1424494-41887 Microsoft Visual C# 2005 Microsoft Visual C++ 2005 77626-009-1424494-41887 Microsoft Visual C++ 2005 Microsoft Visual J# 2005 77626-009-1424494-41887 Microsoft Visual J# 2005 Microsoft Visual Web Developer 2005 77626-009-1424494-41887 Microsoft Visual Web Developer 2005 Microsoft Web Application Projects 2005 77626-009-1424494-41887 Microsoft Web Application Projects 2005 Version 8.0.50727.762 Crystal Reports AAC60-G0CSA4B-V7000AY Crystal Reports for Visual Studio 2005 Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack 1 (KB926601) This service pack is for Microsoft Visual Studio 2005 Professional Edition - ENU. If you later install a more recent service pack, this service pack will be uninstalled automatically. For more information, visit http://support.microsoft.com/kb/926601 Visual Assist X For more information about Visual Assist, see the Whole Tomato Software website at http://www.WholeTomato.com. Copyright (c) 1997-2007 Whole Tomato Software, Inc.
Regards, Arkadiy
Thanks Trigve _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users ____________________________________________________________________________________Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
"Trigve Siver"
class A { public: pqxx::result test(int a) { return pqxx::result(); } }; int main(int argc, char* argv[]) { BOOST_AUTO(rs, a.test(1)); // OK }
One more experiment -- can you change the function signature to accept char* (or maybe some other string type to exactly match the signature of exec()), and use it passing "SELECT 1" to it? Also, can you call: cout << typeid(T.exec("SELECT 1")).name() << endl; and see if it's compiled and what gets output? Regards, Arkadiy
participants (2)
-
Arkadiy Vertleyb
-
Trigve Siver