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 &);
相关推荐
云水初9 小时前
【项目篇】基于LanGraph的自动处理客服邮件的 Agent汇总
开发语言·笔记·python·学习·fastapi·langgraph
茉莉玫瑰花茶9 小时前
GO [ 内存与变量逃逸分析 ]
开发语言·后端·golang
凉茶钱9 小时前
list:哨兵节点,const_iterator 和 const iterator的区别与迭代器失效
数据结构·c++·list
沫璃染墨9 小时前
从零入门计算机网络系列(六):TCP套接字编程实战——从listen监听到客户端与服务器通信
linux·服务器·c++·tcp/ip·计算机网络·tcp
lhh_qrsly9 小时前
OTA 加密完整方案(嵌入式 IoT 常用)
开发语言·物联网·php
Jsundoku9 小时前
第六章 机器学习 -- 支持向量机
算法·机器学习·支持向量机
Nontee9 小时前
Quartz 新手入门:定时任务的两个承诺
开发语言·windows·python
?abc!10 小时前
(数组)448. 找到所有数组中消失的数字
算法
\光辉岁月/10 小时前
2.异常类
java·开发语言·异常类