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 &);
相关推荐
Dlrb121126 分钟前
C语言-指针三
c语言·算法·指针·const·命令行参数
kkeeper~31 分钟前
0基础C语言积跬步之深入理解指针(5下)
c语言·开发语言
Tisfy41 分钟前
LeetCode 2540.最小公共值:双指针(O(m+n))
算法·leetcode·题解·双指针
一直不明飞行41 分钟前
Java的equals(),hashCode()应该在什么时候重写
java·开发语言·jvm
IronMurphy1 小时前
【算法四十七】152. 乘积最大子数组
算法
REDcker1 小时前
有限状态机与状态模式详解 FSM建模Java状态模式与C++表驱动模板实践
java·c++·状态模式
盲敲代码的阿豪1 小时前
Python 入门基础教程(爬虫前置版)
开发语言·爬虫·python
basketball6161 小时前
C++ 构造函数完全指南:从入门到进阶
java·开发语言·c++
互联科技报2 小时前
2026超融合选型:Top5品牌与市场格局解读
开发语言·perl
weixin199701080162 小时前
[特殊字符] 智能数据采集:数字化转型的“数据石油勘探队”(附Python实战源码)
开发语言·python