# Slow Chat Archives > Slow Chat: Visual C++: Yesterday, Today, and Tomorrow >  [RESOLVED] Boost and C++/CLI

## daveJ

I find the Boost libraries very useful in native C++ code.  Do you know if some or all of the libraries would work in managed code?  Thanks.

----------


## joncaves

I must admit that I haven't tried using Boost with C++/CLI though I have tried it with the containers from the C++ Standard Library. I believe that you should be able to do it. The one problem will be with reference types - you are going to have to use the gcroot class to wrap any instances of a reference type - this is necessary so that the GC can keep track of any "references" that are held by the Boost classes.

----------


## daveJ

Is there any way to automate the gcroot wrappers?  With brilliant compiler tricks or something like that?  If Boost and other native code libraries could be used with confidence, it would make C++/CLI much more attractive to mainstream C++ programmers.

----------


## joncaves

While in general it might be possible to do this the compiler would have to take a very pessimistic view and assume if a class template was specialized with a reference type then it should be replaced by the reference type wrapped in gcroot - this could cause problems in some cases.

Much as I love C++ and this compiler I have learnt over the years that the less the compiler does behind the user's back the better.

----------


## daveJ

I see what you mean about how compiler "automation" can go awry.  How about an attribute or #pragma to specify that the enclosed code will be accessed by native code and needs to be wrapped.

I just think it would be great if there was an easy, foolproof(?) way to interface to all the native code libraries out there, particularly Boost.  Thanks for your comments.

----------

