我是靠谱客的博主 无限大神,这篇文章主要介绍Clion提示:Single-argument constructors must be marked explicitly to avoid unintentional implicit conve...,现在分享给大家,希望可以做个参考。

参考:https://www.cnblogs.com/xudong-bupt/p/3671972.html

在写一个类的时候,如果一个构造器是接收单个参数的,那么最好要加上explicit。
如果不加的话,该构造函数还会拥有类型转换的情形,造成混淆。

解决办法:该构造函数的声明前加上explicit。

转载于:https://www.cnblogs.com/theodoric008/p/9465673.html

最后

以上就是无限大神最近收集整理的关于Clion提示:Single-argument constructors must be marked explicitly to avoid unintentional implicit conve...的全部内容,更多相关Clion提示:Single-argument内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(106)

评论列表共有 0 条评论

立即
投稿
返回
顶部