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 &);
相关推荐
闲看云起几秒前
LeetCode-day6:接雨水
算法·leetcode·职场和发展
没学上了13 分钟前
VLM_一维离散卷积与二维离散卷积(还是复习感觉还行)
算法
HL_风神24 分钟前
设计原则之迪米特
c++·学习·设计模式
FL1717131425 分钟前
MATLAB的Sensitivity Analyzer
开发语言·matlab
黛色正浓25 分钟前
leetCode-热题100-贪心合集(JavaScript)
javascript·算法·leetcode
HL_风神26 分钟前
设计原则之合成复用
c++·学习·设计模式
轻微的风格艾丝凡44 分钟前
嵌入式定时器计时技巧:用有符号数省略溢出判断的底层逻辑与实践
数据库·算法·dsp开发·嵌入式软件
No0d1es1 小时前
2025年12月 GESP CCF编程能力等级认证C++四级真题
算法·青少年编程·等级考试·gesp·ccf
汉克老师1 小时前
GESP2025年12月认证C++八级真题与解析(单选题10-12)
c++·递归··gesp八级·gesp8级
lly2024061 小时前
jEasyUI 设置排序指南
开发语言