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 &);
相关推荐
m沐沐几秒前
【深度学习】循环神经网络RNN——结构、原理与长期依赖问题解析
人工智能·pytorch·python·rnn·深度学习·算法·机器学习
Wang's Blog3 分钟前
Go-Zero项目开发38:深入限流器实现与应用
开发语言·golang·go-zero
古道青阳3 分钟前
Duilib 技术全景剖析
c++·windows
风吹心凉11 分钟前
python3基础2026.7.28
开发语言·python
Rabitebla16 分钟前
C++ 内存管理全面复习:从内存分布到 operator new/delete
java·c语言·开发语言·c++·算法·leetcode
xcLeigh17 分钟前
Go入门:main包与main函数的特殊地位
开发语言·后端·golang
玖玥拾24 分钟前
LeetCode 58 最后一个单词的长度
算法·leetcode
SilentSlot35 分钟前
【C/C++】手写 DPDK 协议栈(八):用五元组 Hash 加速连接定位
c语言·c++·哈希算法
LONGZETECH43 分钟前
工业实训仿真设计实践:电机拆装软件的 DAG 流程建模、工具精度分级与数据体系搭建
大数据·算法·unity·架构·汽车
心念枕惊1 小时前
PHP 在领域驱动(DDD)设计中的核心实践
android·开发语言·php