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 &);
相关推荐
Zqrnja3 分钟前
PTA 2026天体选拔赛(多校联赛)L2-1 仪式网络(C++ 含代码解释)
开发语言·c++
llm大模型算法工程师weng8 分钟前
负载均衡做什么?nginx是什么
运维·开发语言·nginx·负载均衡
逆境不可逃10 分钟前
【后端新手谈13】VO、BO、PO、DO、DTO:Java 分层开发的 5 大核心数据对象
java·开发语言
MegaDataFlowers11 分钟前
1.两数之和
算法
古月方枘Fry13 分钟前
三层交换+VRRP实现负载
开发语言·网络·php
qq_54702617918 分钟前
Java 中的 Caffeine 缓存详解
java·开发语言·缓存
H Journey20 分钟前
C++ 强制类型转换
c++·类型转换
froginwe1125 分钟前
JSP 发送邮件
开发语言
AGV算法笔记27 分钟前
二维码检测又卷出新方向:如何在一张图里稳定读取几十甚至上百个二维码?
算法·目标检测·二维码·视觉算法
‎ദ്ദിᵔ.˛.ᵔ₎29 分钟前
map和set
c++