Prevent standard functions outside of std namespace

前端 未结 5 666
梦如初夏
梦如初夏 2021-01-04 01:51

I am using only header files specific to C++ (e.g. ), however I still get globally-declared functions, and not just functions in the std

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-04 02:19

    You can declare your functions in their own namespaces to prevent declaration collision.

    namespace MyFunc
    {
    float random() { return 0.0f; }
    };
    

提交回复
热议问题