Sharing an enum from C#, C++/CLI, and C++
问题 I have a library that consists of three parts. First is native C++, which provides the actual functionality. Second is a C++/CLI wrapper/adaptor for the C++ library, to simplify the C# to C++ transition. Finally I have a C# library, which invokes the C++ library through the C++/CLI adaptor. Right now there I have two sets of parallel enum definitions, one stored in a .cs file and the other in a .h file. This poses a double problem: I have dual maintenance. I must always synchronize changes of