标准库和托管对象 [英] Standard library and managed objects
问题描述
为了更加兴奋,是否可以在VC ++ 2005 / .NET 2.0时代使用标准库
带有句柄的
容器?
像这样:
vector< Button ^> buttonArray;
和堆栈中的托管对象:
vector< Button> buttonArray; //?
问候,
Ioannis Vranos
< blockquote>我们正在使用与标准STL相同的模式来处理库,
与ref,value和enum类类型一起使用。它不是Beta 1,但我们希望它能为VS 2005制作Beta 2(并发布)。
Ronald Laeremans
Visual C ++团队
" Ioannis Vranos" < iv*@guesswh.at.grad.com>在留言中写道
新闻:uZ ************** @ TK2MSFTNGP11.phx.gbl ...
所以更兴奋,VC ++ 2005 / .NET 2.0时代可以使用带句柄的标准库
容器吗?
这样:
vector< Button ^> buttonArray;
以及堆栈中的托管对象:
vector< Button> buttonArray; //?
问候,
Ioannis Vranos
文档I'已经看到Whidbey说你仍然需要使用
gcroot,这是一种耻辱。如果编译器可以在你看到未处理的
对象中的^时为你自动生成句柄包装,那将是很好的。
std :: vector< gcroot< Button ^> > buttonArray;
干杯
Russell
Ioannis Vranos写道:
那么为了更加兴奋,是否可以在VC ++ 2005 / .NET 2.0时代使用带句柄的标准库
容器?
像这样:
vector< Button ^> buttonArray;
以及堆栈中的托管对象:
vector< Button> buttonArray; //?
问候,
Ioannis Vranos
Russell Hind写道:我见过Whidbey的文档说你仍然需要使用
gcroot这是一种耻辱。如果编译器在看到非托管
对象中的^时自动生成句柄包装将会很好。
std :: vector< gcroot< Button ^> > buttonArray;
以上风格很蹩脚。我听说过托管和非托管代码
可以在VS 2005中更优雅地组合(类似于
使用托管对象的STL库)。以上意思是,
一切都是一样的!
问候,
Ioannis Vranos
So to be more excited, will it be possible to use standard library
containers with handles in VC++ 2005/.NET 2.0 era?
Like this:
vector<Button ^>buttonArray;
and with managed objects in the stack:
vector<Button>buttonArray; // ?
Regards,
Ioannis Vranos
We are working on a library using the same patterns as standard STL that
works with ref, value and enum class types. It is not in Beta 1, but we hope
that it will make Beta 2 (and release) for VS 2005.
Ronald Laeremans
Visual C++ team
"Ioannis Vranos" <iv*@guesswh.at.grad.com> wrote in message
news:uZ**************@TK2MSFTNGP11.phx.gbl...So to be more excited, will it be possible to use standard library
containers with handles in VC++ 2005/.NET 2.0 era?
Like this:
vector<Button ^>buttonArray;
and with managed objects in the stack:
vector<Button>buttonArray; // ?
Regards,
Ioannis Vranos
The documentation I''ve seen for Whidbey says you still have to use
gcroot which is a shame. It would be nice if the compiler could
auto-generate the handle-wrapping for you when it saw the ^ in unmanaged
objects.
std::vector<gcroot<Button^> > buttonArray;
Cheers
Russell
Ioannis Vranos wrote:
So to be more excited, will it be possible to use standard library
containers with handles in VC++ 2005/.NET 2.0 era?
Like this:
vector<Button ^>buttonArray;
and with managed objects in the stack:
vector<Button>buttonArray; // ?
Regards,
Ioannis Vranos
Russell Hind wrote:The documentation I''ve seen for Whidbey says you still have to use
gcroot which is a shame. It would be nice if the compiler could
auto-generate the handle-wrapping for you when it saw the ^ in unmanaged
objects.
std::vector<gcroot<Button^> > buttonArray;
The above style is lame. I had heard that managed and unmanaged code
would be able to be combined more elegantly in VS 2005 (something like
"an STL library working with managed objects"). The above means, that
everything remains the same!
Regards,
Ioannis Vranos
这篇关于标准库和托管对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!