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 &);
相关推荐
疯狂打码的少年9 分钟前
【Day 6 Java转Python】字符串处理的“降维打击”
java·开发语言·python
汀、人工智能27 分钟前
[特殊字符] 第103课:单词搜索II
数据结构·算法·均值算法·前缀树·trie·单词搜索ii
hogenlaw39 分钟前
Stream流
android·java·开发语言
憧憬从前1 小时前
算法学习记录DAY1
c++·学习
ShCDNay1 小时前
Python核心底层知识(个人记录)
开发语言·python
xyq20241 小时前
组合实体模式
开发语言
来自远方的老作者1 小时前
第7章 运算符-7.2 赋值运算符
开发语言·数据结构·python·赋值运算符
A.A呐1 小时前
【C++第二十四章】异常
开发语言·c++
wanderist.1 小时前
算法模板-字符串
数据结构·算法·哈希算法
xiaoye-duck1 小时前
《算法题讲解指南:动态规划算法--子序列问题》--29.最长递增子序列的个数,30.最长数对链,31.最长定差子序列
c++·算法·动态规划