std::queue and Managed class
-
Hi all, I'm trying to do the following : std::queue m_qSomeName; but I get the following compile error ...\Vc7\include\deque(59): error C2847: cannot apply sizeof to managed type 'TestApp1::MyManagedClass' ok.. so I changed MyManagedClass to a non Managed Class, and now I get a different compile error: ...\TestApp1\MyServer.h(29): error C3633: cannot define 'm_qSomeName' as a member of managed 'TestApp1::MyServer' Now I'm just trying things out, but is it not possible to use the std::queue template class in managed c++? what about other STL classes? Before anyone says, why aren't you using .NET queue/list classes. I'm geniunely curious why I am not able to use STL Thanx :)
-
Hi all, I'm trying to do the following : std::queue m_qSomeName; but I get the following compile error ...\Vc7\include\deque(59): error C2847: cannot apply sizeof to managed type 'TestApp1::MyManagedClass' ok.. so I changed MyManagedClass to a non Managed Class, and now I get a different compile error: ...\TestApp1\MyServer.h(29): error C3633: cannot define 'm_qSomeName' as a member of managed 'TestApp1::MyServer' Now I'm just trying things out, but is it not possible to use the std::queue template class in managed c++? what about other STL classes? Before anyone says, why aren't you using .NET queue/list classes. I'm geniunely curious why I am not able to use STL Thanx :)
I have not tried to store managed object pointers in STL collections, I can imagine there could be many perils in that even if it was supported. I have used STL vector in a "mixed mode" exe project in VS 2003
std::vector<LPCTSTR> strV;
So STL will compile and execute within a mixed mode project. But as you can see I was not mixing STL and Managed types."No matter where you go, there your are." - Buckaroo Banzai
-pete
-
I have not tried to store managed object pointers in STL collections, I can imagine there could be many perils in that even if it was supported. I have used STL vector in a "mixed mode" exe project in VS 2003
std::vector<LPCTSTR> strV;
So STL will compile and execute within a mixed mode project. But as you can see I was not mixing STL and Managed types."No matter where you go, there your are." - Buckaroo Banzai
-pete
thanx for your reply Palbano, yeh i've been able to use standard objects in an stl vector but not managed ones. oh well. i can just live with out it. would have been nice to know though :) thanx If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
-
thanx for your reply Palbano, yeh i've been able to use standard objects in an stl vector but not managed ones. oh well. i can just live with out it. would have been nice to know though :) thanx If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
check out this article over at codeguru which talks about mixing STL with the .NET Base Class Library. http://www.codeguru.com/columns/Kate/article.php/c4849/[^] ade me; while(myKitchen.beerInFridge()) { me.watchTV(); me.consumeBeer(myKitchen.getBeerCan()); }