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 &);
相关推荐
寻星探路1 分钟前
【Python 全栈测开之路】Python 进阶:库的使用与第三方生态(标准库+Pip+实战)
java·开发语言·c++·python·ai·c#·pip
2301_800256111 小时前
第九章:空间网络模型(空间网络查询、数据模型、Connected、with Recursive、pgRouting)
网络·数据库·算法·postgresql·oracle
逑之2 小时前
C语言笔记10:sizeof和strlen,指针与数组
c语言·笔记·算法
求梦8202 小时前
【力扣hot100题】旋转图像(15)
算法·leetcode·职场和发展
C雨后彩虹6 小时前
任务最优调度
java·数据结构·算法·华为·面试
SmartRadio8 小时前
CH585M+MK8000、DW1000 (UWB)+W25Q16的低功耗室内定位设计
c语言·开发语言·uwb
rfidunion8 小时前
QT5.7.0编译移植
开发语言·qt
少林码僧8 小时前
2.31 机器学习神器项目实战:如何在真实项目中应用XGBoost等算法
人工智能·python·算法·机器学习·ai·数据挖掘
钱彬 (Qian Bin)8 小时前
项目实践15—全球证件智能识别系统(切换为Qwen3-VL-8B-Instruct图文多模态大模型)
人工智能·算法·机器学习·多模态·全球证件识别
rit84324998 小时前
MATLAB对组合巴克码抗干扰仿真的实现方案
开发语言·matlab