我是靠谱客的博主 无限大神,最近开发中收集的这篇文章主要介绍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 constructors must be marked explicitly to avoid unintentional implicit conve...所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部