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 &);
相关推荐
Momentary_SixthSense13 小时前
设计模式之工厂模式
java·开发语言·设计模式
‎ദ്ദിᵔ.˛.ᵔ₎13 小时前
STL 栈 队列
开发语言·c++
勿忘,瞬间13 小时前
数据结构—顺序表
java·开发语言
张張40813 小时前
(域格)环境搭建和编译
c语言·开发语言·python·ai
weixin_4235339913 小时前
【Windows11离线安装anaconda、python、vscode】
开发语言·vscode·python
2401_8920709813 小时前
【Linux C++ 日志系统实战】高性能文件写入 AppendFile 核心方法解析
linux·c++·日志系统·文件写对象
fzb5QsS1p13 小时前
告别重复造轮子,Qt 快速开发脚手架
开发语言·qt·php
郭涤生13 小时前
STL vector 扩容机制与自定义内存分配器设计分析
c++·算法
航Hang*13 小时前
第3章:Linux系统安全管理——第2节:部署代理服务
linux·运维·服务器·开发语言·笔记·系统安全
周杰伦fans13 小时前
C# required 关键字详解
开发语言·网络·c#