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 &);
相关推荐
無限進步D2 小时前
Java 运行原理
java·开发语言·入门
是苏浙2 小时前
JDK17新增特性
java·开发语言
阿里加多5 小时前
第 4 章:Go 线程模型——GMP 深度解析
java·开发语言·后端·golang
likerhood5 小时前
java中`==`和`.equals()`区别
java·开发语言·python
IronMurphy5 小时前
【算法三十九】994. 腐烂的橘子
算法
zs宝来了6 小时前
AQS详解
java·开发语言·jvm
Ares-Wang7 小时前
算法》》旅行商问题 TSP、7座桥问题 哈密顿回路 深度优先 和 宽度优先
算法·深度优先·宽度优先
Liqiuyue7 小时前
Transformer:现代AI革命背后的核心模型
人工智能·算法·机器学习
WolfGang0073217 小时前
代码随想录算法训练营 Day34 | 动态规划 part07
算法·动态规划
telllong7 小时前
Python异步编程从入门到不懵:asyncio实战踩坑7连发
开发语言·python