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 &);
相关推荐
有点。32 分钟前
C++ ⼀级 2024 年 03 ⽉
c++
酒尘&33 分钟前
JS数组不止Array!索引集合类全面解析
开发语言·前端·javascript·学习·js
冬夜戏雪44 分钟前
【java学习日记】【2025.12.7】【7/60】
java·开发语言·学习
xwill*1 小时前
分词器(Tokenizer)-sentencepiece(把训练语料中的字符自动组合成一个最优的子词(subword)集合。)
开发语言·pytorch·python
CC.GG1 小时前
【C++】二叉搜索树
java·c++·redis
咖啡の猫1 小时前
Python列表的查询操作
开发语言·python
Savior`L2 小时前
二分算法及常见用法
数据结构·c++·算法
深海潜水员2 小时前
OpenGL 学习笔记 第一章:绘制一个窗口
c++·笔记·学习·图形渲染·opengl
quikai19812 小时前
python练习第三组
开发语言·python
JIngJaneIL2 小时前
基于Java非遗传承文化管理系统(源码+数据库+文档)
java·开发语言·数据库·vue.js·spring boot