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 &);
相关推荐
@三十一Y12 分钟前
C++:AVL树实现
c++
ShineWinsu1 小时前
对于Linux:传输层协议UDP原理的解析
linux·c++·面试·udp·协议·传输层·计算机系统
LingzhiPi1 小时前
零知派ESP32--AS5600磁吸旋钮音量控制器
c++·单片机·嵌入式硬件
小保CPP1 小时前
OpenCV C++车型识别1-图像预处理
c++·人工智能·opencv·计算机视觉
霸道流氓气质1 小时前
分布式系统中接口时序不确定性处理
java·开发语言·分布式
库克克2 小时前
【C++】C++11 包装器function 与 绑定器 bind
开发语言·c++
多加点辣也没关系2 小时前
JavaScript|第30章:事件机制
开发语言·javascript
小大宇2 小时前
python milvus 案例
开发语言·python·milvus
小小龙学IT2 小时前
C++ Placement New 与显式析构:手动对象生命周期管理的艺术
c++·windows·mfc
Gauss松鼠会2 小时前
【GaussDB】GaussDB锁阻塞源头查询
java·开发语言·前端·数据库·算法·gaussdb·经验总结