如何使用VEC2类处理许多库
我正在编写一个程序,该程序开始变得太大而无法单独编译。
在该项目中,我有许多“模块”,我认为我可以带出来成为他们自己的图书馆,这将使我能够在以后的项目中使用这些图书馆。
但是,许多这些库都取决于某种形式的简单2D点类(float x,float y)。
我的问题是我不知道如何在每个库中处理VEC2类,我是否在库的名称空间中编写一个简单的VEC2类,还是应该迫使用户首先安装其他共享库?
我怀疑第二个建议是理想的建议,但是我宁愿我的库对它们没有膨胀,因为它们主要包括一个.cpp + .h文件。
I am writing a program which is starting to get too big to compile individually.
Within the project, I have a number of 'modules' which I think I can take out to become their own library, and this will allow me to use those libraries in future projects.
A lot of these libraries however are dependant on some form of a simple 2D point class (float x, float y).
My issue is that I don't know how I should handle the Vec2 class within each library, do I write a simple Vec2 class within the library's namespace or should I force the user to install an additional shared library first?
I suspect the second suggestion is the ideal one however I would rather my libraries had no bloat to them as they will mostly include just a single .cpp + .h file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论