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 &);
相关推荐
echome8881 分钟前
Go 语言并发编程:sync.WaitGroup 实战指南
开发语言·golang·xcode
爱和冰阔落3 分钟前
【C++STL上】栈和队列模拟实现 容器适配器 力扣经典算法秘籍
数据结构·c++·算法·leetcode·广度优先
程序员-King.3 分钟前
day162—递归—买卖股票的最佳时机Ⅱ(LeetCode-122)
算法·leetcode·深度优先·递归
Gorgous—l3 分钟前
数据结构算法学习:LeetCode热题100-贪心算法篇(数组中的第K个最大元素、 前 K 个高频元素、数据流的中位数)
数据结构·学习·算法
一叶落4384 分钟前
LeetCode 300. 最长递增子序列(LIS)详解(C语言 | DP + 二分优化)
c语言·数据结构·c++·算法·leetcode
Darkwanderor5 分钟前
数据结构——trie(字典)树
数据结构·c++·字典树·trie树
灰色小旋风6 分钟前
力扣第11题C++盛最多水的容器
数据结构·算法·leetcode
一匹电信狗6 分钟前
【LeetCode面试题17.04】消失的数字
c语言·开发语言·数据结构·c++·算法·leetcode·stl
j_xxx404_7 分钟前
从 O(N) 到 O(log N):LCR 173 点名问题的五种解法与最优推导
开发语言·c++·算法
xxxxxxllllllshi7 分钟前
【LeetCode Hot100----12-栈(01-06),包含多种方法,详细思路与代码,让你一篇文章看懂所有!】
算法·leetcode·职场和发展