C++ //练习 18.14 假设下面的operator*声明的是嵌套的命名空间mathLib::MatrixLib的一个成员:

C++ Primer(第5版) 练习 18.14

练习 18.14 假设下面的operator*声明的是嵌套的命名空间mathLib::MatrixLib的一个成员:

cpp 复制代码
namespace mathLIb{
	namespace MatrixLib{
		class matrix { /* ... */ };
		matrix operator*(const matrix &, const matrix &);
		// ...
	}
}

请问你应该如何在全局作用域中声明该运算符?

环境:Linux Ubuntu(云服务器)
工具:vim
解释
cpp 复制代码
namespace mathLIb{
	namespace MatrixLib{
		class matrix { /* ... */ };
		matrix operator*(const matrix &, const matrix &);
		// ...
	}
}

mathLib::MatrixLib::matrix mathlib::MatrixLib::operator*(const matrix &, const matrix &);
相关推荐
IronMurphy10 小时前
【算法二十二】 739. 每日温度 42.接雨水
算法
一轮弯弯的明月10 小时前
竞赛刷题-建造最大岛屿-Java版
java·算法·深度优先·图搜索算法·学习心得
geovindu10 小时前
python: Simple Factory Pattern
开发语言·python·设计模式·简单工厂模式
黑眼圈子10 小时前
牛客刷题记录1
算法
祁同伟.10 小时前
【C++】哈希的应用
开发语言·数据结构·c++·算法·容器·stl·哈希算法
点云SLAM10 小时前
Tracy Profiler 是目前 C++ 多线程程序实时性能分析工具
开发语言·c++·算法·slam·算法性能分析·win环境性能分析·实时性能分析工具
每天回答3个问题10 小时前
leetcodeHot100|148.排序链表
数据结构·c++·链表·ue4
We་ct10 小时前
LeetCode 17. 电话号码的字母组合:回溯算法入门实战
前端·算法·leetcode·typescript·深度优先·深度优先遍历
吃着火锅x唱着歌10 小时前
LeetCode 447.回旋镖的数量
算法·leetcode·职场和发展
承渊政道10 小时前
C++学习之旅【unordered_map和unordered_set的使⽤以及哈希表的实现】
c语言·c++·学习·哈希算法·散列表·hash-index