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 &);
相关推荐
WL学习笔记3 分钟前
类和对象(下)
c++·类和对象
Nil2086 分钟前
leetcode 300最长递增子序列
算法·leetcode·职场和发展
wewowilling18 分钟前
AI大模型开发--01Python基础(无废话)
开发语言·python·函数
小羊没烦恼!26 分钟前
OS X 上使用.NET开发应用程序
开发语言·前端·数据库·人工智能·c#·策略模式
棉猴29 分钟前
玩游戏学Python5-函数
开发语言·python·函数·玩游戏·游戏编程
傲世仙尊33 分钟前
拷贝构造-传值传参的连锁反应与隐式函数的三个局限
c++
垆边人似月.1 小时前
华为机试题 :最大数
c++·算法·华为
谢亮_vipxieliang1 小时前
JavaScript this 指向完全指南:调用位置决定一切
开发语言·javascript·ecmascript
denlaku1 小时前
JDK 13 新特性详解
java·开发语言
念越1 小时前
题库、练习与错题本代码阅读
开发语言·数据结构