Click here to Skip to main content
15,885,278 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
Questionset_union question (about the parameter _Result) Pin
followait2-Mar-09 3:51
followait2-Mar-09 3:51 
AnswerRe: set_union question (about the parameter _Result) Pin
Stuart Dootson2-Mar-09 7:25
professionalStuart Dootson2-Mar-09 7:25 
GeneralRe: set_union question (about the parameter _Result) Pin
followait2-Mar-09 14:41
followait2-Mar-09 14:41 
GeneralRe: set_union question (about the parameter _Result) Pin
«_Superman_»2-Mar-09 17:52
professional«_Superman_»2-Mar-09 17:52 
GeneralRe: set_union question (about the parameter _Result) Pin
Stuart Dootson2-Mar-09 19:20
professionalStuart Dootson2-Mar-09 19:20 
QuestionPerformance clarification on vectors? Pin
mmayur27-Feb-09 5:58
mmayur27-Feb-09 5:58 
AnswerRe: Performance clarification on vectors? Pin
Stuart Dootson27-Feb-09 8:19
professionalStuart Dootson27-Feb-09 8:19 
Questionhelp: A C++ template question [modified] Pin
yellowine24-Feb-09 11:12
yellowine24-Feb-09 11:12 
I have the following codes (partially copied for illustration) using template class:


template<typename T>
struct _BoundingBox
{
T x0, x1, y0, y1;
};

template<typename T>
class CMyObject
{
public:
typedef struct _BoundingBox<t> stBBOX;

CMyObject()
{
Init(); // do class initialization here
}
CMyObject(const CMyObject<t> &Obj) // copy constructor
{
// do some data copy here
....
_Box = Obj.GetBountingBox();
}

virtual ~CMyObject() {}
public:
stBBOX GetBoundingBox() { return _Box; }

protected:
stBBOX _Box;
};

int main(argc, char* argv[])
{
CMyObject<int> obj1
CMyObject<int> obj2(obj1);
}


After compile (using VC 2005, the compiler gave the following error message:

error C2662: 'CMyObject<t>::GetBoundingBox' : cannot convert 'this' pointer from 'const CMyObject<t>' to 'CMyObject<t> &'
with
[
T=int
]
Conversion loses qualifiers

However, if I change

_Box = Obj.GetBountingBox();

to

_Box = Obj._Box;

in the copy constructor, the error disappears.

Anyone knows what the problem is? Thanks. </t></t></t>

<div class="ForumMod">modified on Tuesday, February 24, 2009 5:18 PM</div>
AnswerRe: help: A C++ template question Pin
Stuart Dootson24-Feb-09 11:20
professionalStuart Dootson24-Feb-09 11:20 
GeneralRe: help: A C++ template question Pin
yellowine24-Feb-09 11:24
yellowine24-Feb-09 11:24 
GeneralRe: help: A C++ template question Pin
Stuart Dootson24-Feb-09 12:53
professionalStuart Dootson24-Feb-09 12:53 
QuestionMap access violation problem with release build Pin
Kyudos23-Feb-09 15:30
Kyudos23-Feb-09 15:30 
AnswerRe: Map access violation problem with release build Pin
Kyudos23-Feb-09 16:15
Kyudos23-Feb-09 16:15 
AnswerRe: Map access violation problem with release build Pin
Stuart Dootson24-Feb-09 8:48
professionalStuart Dootson24-Feb-09 8:48 
GeneralRe: Map access violation problem with release build Pin
Kyudos24-Feb-09 9:39
Kyudos24-Feb-09 9:39 
AnswerRe: Map access violation problem with release build Pin
Kyudos24-Feb-09 10:06
Kyudos24-Feb-09 10:06 
GeneralRe: Map access violation problem with release build Pin
Stuart Dootson24-Feb-09 10:17
professionalStuart Dootson24-Feb-09 10:17 
GeneralRe: Map access violation problem with release build Pin
Kyudos24-Feb-09 10:41
Kyudos24-Feb-09 10:41 
AnswerRe: Map access violation problem with release build - CAPITULATION! Pin
Kyudos24-Feb-09 10:38
Kyudos24-Feb-09 10:38 
GeneralRe: Map access violation problem with release build - CAPITULATION! Pin
Stuart Dootson24-Feb-09 11:13
professionalStuart Dootson24-Feb-09 11:13 
GeneralRe: Map access violation problem with release build - CAPITULATION! Pin
Rupen Patel8-Apr-10 8:41
Rupen Patel8-Apr-10 8:41 
QuestionHow to invoke IPimSrcContactNew::Create Pin
benchi200622-Feb-09 21:59
benchi200622-Feb-09 21:59 
AnswerRe: How to invoke IPimSrcContactNew::Create Pin
Stuart Dootson24-Feb-09 8:41
professionalStuart Dootson24-Feb-09 8:41 
GeneralRe: How to invoke IPimSrcContactNew::Create Pin
benchi200624-Feb-09 14:19
benchi200624-Feb-09 14:19 
GeneralRe: How to invoke IPimSrcContactNew::Create Pin
Stuart Dootson24-Feb-09 21:15
professionalStuart Dootson24-Feb-09 21:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.