views:

133

answers:

2

I would like to introduce unit testing to our C++ product and wanted to investigate the pros and cons of trying to use the CLR-based unit tests. I've read that if you compile with the /clr:safe option, you can call your existing C++ code.

I'm strictly a .NET developer, so I'm at a loss for how this would affect our codebase. What should I know about before I try to introduce this to the C++ team?

+2  A: 

It's not going to work, at all. The C++ code will not compile under /clr:safe; pretty much every line will give an error. /clr:safe gets you a language that basically shares no datatypes with C++.

MSalters
+1  A: 

/clr:safe will allow you to use "C++.NET", which is not likely the same thing that a "C++" team works with. Unless they're willing to recode to use ".NET C++" (which has the ^ operator for 'new objects on the heap' for starters) their stuff won't work.

GWLlosa