Re: returning a map <int, stuct> from my member function in my class

Posted by Jan Ladislav Dussek on
URL: http://quantlib.414.s1.nabble.com/returning-a-map-int-stuct-from-my-member-function-in-my-class-tp13905p13906.html

Define Rows outside of the function. If your struct is defined inside the function, then it cannot be made visible outside that function. In particular, it cannot be used as the return type of the function, which should be map<int,Rows> in any case.


Date: Fri, 11 Jan 2013 10:05:58 -0800
From: [hidden email]
To: [hidden email]
Subject: [Quantlib-users] returning a map <int, stuct> from my member function in my class

Hello,

I have a function that returns a map <int, struct> .

However, the compiler complains.

my function declaration in my class is as follows:

map <int, struct> test_class:: test function().

In my function, 
I define a struct Rows.
and my map is 
map<int,Rows> Options

.
..
. return Options;
compiler doesn't like that.

There are messages:
1) one that is related to map <int, struct>   :  "Expected either a definition or a tag name" 
2)one at the return statement : "no suitable user -defined conversion from "..." exists.

Any ideas please?  It should be something simple that I am missing in my code.
thanks
Pavan

------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812
_______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users