Is it OK to use boost::shared ptr in DLL interface?

前端 未结 5 564
臣服心动
臣服心动 2021-01-04 19:21

Is it valid to develop a DLL in C++ that returns boost shared pointers and uses them as parameters?

So, is it ok to export functions like this?

1.) b         


        
5条回答
  •  感情败类
    2021-01-04 19:45

    In my opinion, if it's not in the standard and it's not an object/mechanism provided by your library, then it shouldn't be part of the interface to the library. You can create your own object to do the reference counting, and perhaps use boost underneath, but it shouldn't be explicitly exposed in the interface.

提交回复
热议问题