草庐IT

Size_type

全部标签

Global SiC MOSFET Modules Market Size Is Projected to Grow from USD 1693 million in 2023

Accordingtothenewmarketresearchreport“GlobalSiCMOSFETModulesMarketReport2023-2029”,publishedbyGlobalInfoResearch,theglobalSiCMOSFETModulesmarketsizeisprojectedtogrowfromUSD1693millionin2023toUSD9218.2millionby2029,ataCAGRof32.6%duringtheforecastperiod.Figure.GlobalSiCMOSFETModulesMarketSize (US$Mill

c++ - 如果 new_size 不大于旧的,C++ 标准是否保证 std::string::resize(new_size) 不会导致分配?

这个问题在这里已经有了答案:Doesthestandardguarantee,thatstd::string::resizewillnotdoreallocatememory,ifthenewsizeislessthanorequaltoastheoldone?(1个回答)关闭3年前。#include#includeintmain(){autos="hello"s;autop=&s[0];s.resize(3);assert('h'==*p);//alwaysok?}如果new_size不大于旧的,C++标准是否保证std::string::resize(new_size)不会导致分配

c++ - 是否允许在 requires 表达式中为 return-type-requirement 指定类型?

看看这个简单的概念示例:templaterequiresrequires(Tt){{t+t}->bool;}voidfn(){}intmain(){fn();}这里,我使用bool作为return-type-requirement的type-constraint。当前稿says:type-constraint:nested-name-specifieroptconcept-namenested-name-specifieroptconcept-name所以type-constraint必须是一个concept-name。bool(或任何类型)是否允许作为概念名称?如果是,那是什么意思,

c++ - 为什么从 size_t 转换为 unsigned int 会给我一个警告?

我有代码:unsignedintlength=strlen(somestring);我正在编译警告级别为4,它告诉我“从size_t到unsignedint的转换,当size_t时可能丢失数据”是typedef对于unsignedint.为什么!?编辑:我刚刚解决了我自己的问题。我是XP用户,我的编译器正在检查64位兼容性。自size_t取决于平台,对于64位,它将是unsignedlonglong,这与unsignedint不同. 最佳答案 因为unsignedint在您的机器上是比size_t更窄的类型。size_t很可能是64

c++ - 为什么 stdarg.h 有一个宏 « __va_size »?

我正在寻找一些关于宏的代码,我找到了这样的代码,用于宏«va_start»:#define__va_argsiz(t)\(((sizeof(t)+sizeof(int)-1)/sizeof(int))*sizeof(int))#defineva_start(ap,pN)\((ap)=((va_list)(&pN)+__va_argsiz(pN)))我想知道«__va_argsiz»函数的目标到底是什么。是对齐限制吗?谢谢! 最佳答案 C中的对齐和默认类型提升规则。 关于c++-为什么st

c++ - 嵌套类中的 "Invalid covariant return type"错误,其方法返回基于模板的对象

下面的C++代码在编译时给我这些错误:covariant.cpp:32:22:error:invalidcovariantreturntypefor‘virtualQC::test()’covariant.cpp:22:22:error:overriding‘virtualQB::test()’我不想更改行virtualQtest(){}至virtualQtest(){}尽管它消除了编译错误。有没有其他方法可以解决这个问题?templateclassQ{public:Q(){}virtual~Q(){}};classA{public:A(){}virtual~A(){}};classB

c++ - C++14 是否要求删除表达式必须调用 `void operator::delete(void*, std::size_t)` 而不是 `void::operator delete(void*)` ?

根据thisvoidoperatordelete(void*);(1)voidoperatordelete[](void*);(2)voidoperatordelete(void*,conststd::nothrow_t&);(3)voidoperatordelete[](void*,conststd::nothrow_t&);(4)voidoperatordelete(void*,std::size_t)(5)voidoperatordelete[](void*,std::size_t)(6)voidoperatordelete(void*,std::size_t,conststd:

带负操作数的 C++ size_t 模运算

因此,模运算可以为您提供三个值:然后:-7%5=3(数学,余数>=0)-7%5=-2(C++)-7%(size_t)5=4(C++)另一个例子:-7%4=1(数学,余数>=0)-7%4=-3(C++)-7%(size_t)4=1(C++)当左手操作数为正时,三种方法的答案都是一样的。但是对于负值,他们似乎都有自己的方法。C++中无符号操作数取模运算的值是如何计算的? 最佳答案 这就是混合有符号和无符号值时发生的情况——困惑![C++14:5.6/2]:Theoperandsof*and/shallhavearithmeticorun

c++ - 海湾合作委员会 4.1.2 : error: integer constant is too large for ‘long’ type

我编译了一段关于散列函数的代码并得到了错误:整数常量对于‘long’类型来说太大了。我用谷歌搜索了一下,它说要添加后缀“ULL”,但我确实有ULL作为后缀。这个后缀只有gcc4.4.1支持,我机器上只有gcc4.1.2,不允许安装新的编译器。有什么方法可以更改代码以解决问题吗?谢谢,-托尼unsignedlonglonghash(stringk){//FNVhashunsignedlonglongx=14695981039346656037ULL;for(unsignedinty=0;y 最佳答案 1099511628211对于(3

c++ - "Type"不引用 C++ 上的值

我在OpenFrameworks图稿中遇到此错误。但似乎是一个简单的C++问题。ofVec2fdoesnotrefertoavalue当然,我在使用指针时遇到了问题,但我不明白为什么。我试图改变&->*Canvas4.cppvoidCanvas4::createStuff(){ballCollection.clear();for(inti=0;i.5)dir=-1;myBall=newBall(org,loc,radius,dir,offSet);ballCollection.push_back(*myBall);}//这是Ball类的构造函数;Ball::Ball(ofVec2f&_