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 &);
相关推荐
朔北之忘 Clancy5 小时前
2025 CSP-J 第二轮真题解析
c++·青少年编程·题解·noip·csp·信奥赛·noi
longlongzihan5 小时前
LeetCode 17电话号码的字母组合:回溯算法(DFS)详解
c++·算法·leetcode·深度优先
落魄实习生5 小时前
Agent Scope Java 2.x 系列【7】工具使用
java·开发语言·ai
yolo_guo5 小时前
调试mysql延迟与libevent回调实际发送回复时机问题
c++·mysql·libevent
封印师请假去地球钓鱼5 小时前
边解边变的问题:从“决策依赖“一词出发
人工智能·算法
茉莉玫瑰花茶6 小时前
GO [ 方法 ]
开发语言·后端·golang
今晚打老虎6 小时前
c++之提高A(前缀和)(第三课)
数据结构·c++·算法
狗凯之家源码网6 小时前
微博图床 PHP 系统搭建与实战应用指南
android·开发语言·php
不会就选b7 小时前
算法日常・每日刷题--<贪心>26
数据结构·算法
by209998 小时前
从结构体到对象:正式学习C++类的骨架、封装与this指针
c++·经验分享·学习