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 &);
相关推荐
n 55!w !108几秒前
js练习作业
开发语言·javascript·ecmascript
冷崖1 分钟前
桥模式-结构型
c++·设计模式
Whisper_Sy2 分钟前
Flutter for OpenHarmony移动数据使用监管助手App实战 - 月报告实现
android·开发语言·javascript·网络·flutter·ecmascript
灰灰勇闯IT2 分钟前
【Flutter for OpenHarmonyDart 入门日记】第5篇:字典类型 Map 与动态类型 dynamic 全解析
开发语言·javascript·ecmascript
D_evil__3 分钟前
【Effective Modern C++】第三章 转向现代C++:9. 优先选用别名声明,而非typedef
c++
leaves falling3 分钟前
c语言- 有序序列合并
c语言·开发语言·数据结构
雨季6665 分钟前
Flutter for OpenHarmony 入门实践:从 Scaffold 到 Container 的三段式布局构建
开发语言·javascript·flutter
Dreamy smile7 分钟前
JavaScript 继承与 this 指向操作详解
开发语言·javascript·原型模式
副露のmagic9 分钟前
更弱智的算法学习 day53
开发语言·python
HellowAmy9 分钟前
我的C++规范 - 回调的设想
开发语言·c++·代码规范