C++ using keyword

后端 未结 4 1267
醉话见心
醉话见心 2021-02-12 22:27

What is the difference between these two usage of using keyword:

using boost::shared_ptr;

and

using namespace boo         


        
4条回答
  •  春和景丽
    2021-02-12 23:30

    The first only allows you to use the name shared_ptr without the boost:: prefix. The second allows you to use any and all names in the boost namespace withoout the boost:: prefix. Some people frown on the latter but it's never given me any problems.

提交回复
热议问题