草庐IT

METHOD_NAME

全部标签

class - Class< 的语法是什么?在 kotlin 中扩展 class_name>?

我正在尝试创建一个接受从Word_Class继承的任何类变量但它不起作用的Arraylist:varlst=ArrayList>();lst.add(Class);我正在寻找Class 最佳答案 您可以使用outtypeprojection在Kotlin。它相当于?扩展Java中的T,例如://v---outtypeprojectionvarlst=ArrayList>()要获得一个Java类你应该使用KClass#java,例如://v---getaKClassinstancelst.add(Noun_Class::class.j

c++ - 在 OSX 10.9.1 上使用 g++ 编译时出错 : unknown type name '__darwin_wctype_t'

在OSX10.9.1上使用g++从命令行编译基本代码(我附加了一个helloworld作为示例)时#includeintmain(){std::cout我用命令编译:g++hello.cc-ohw这会生成以下错误消息:Infileincludedfromhello.cc:1:Infileincludedfrom/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iostream:38:Infileincludedfrom/Applicat

android - Kotlin + Dagger2 : cannot be provided without an @Inject constructor or from an @Provides- or @Produces-annotated method

我收到以下错误:Error:(8,1)error:java.lang.Stringcannotbeprovidedwithoutan@Injectconstructororfroman@Provides-or@Produces-annotatedmethod.我一直在尝试制作一个提供两个合格字符串的模块。这是Dagger的简化设置。@Singleton@Component(modules=[GreetingsModule::class])interfaceAppComponent{funinject(activity:MainActivity)}@Qualifierannotation

android - Kotlin + Dagger2 : cannot be provided without an @Inject constructor or from an @Provides- or @Produces-annotated method

我收到以下错误:Error:(8,1)error:java.lang.Stringcannotbeprovidedwithoutan@Injectconstructororfroman@Provides-or@Produces-annotatedmethod.我一直在尝试制作一个提供两个合格字符串的模块。这是Dagger的简化设置。@Singleton@Component(modules=[GreetingsModule::class])interfaceAppComponent{funinject(activity:MainActivity)}@Qualifierannotation

c++ - 无法编译任何 C++ 程序;错误 : unknown type name 'uint8_t'

EDIT2:问题是不是简单的打印错误。我在下面的日志中打错了字,我更正了,但问题仍然存在。编辑:在下面尝试之后,我错误地使用gcc而不是g++运行了一次。问题在g++之前就存在,现在也存在。我目前使用的是MacOSHighSierra机器。我最近将很多文件从MacBookAir移到了这台机器上,包括我认为都是Xcode的垃圾。现在,当我尝试编译一个非常简单的C++程序时:#includeintmain(){//VAR_DECinta=4;//VAR_MANIPa=a*2;//VAR_PRINTstd::cout我收到以下荒谬的错误:jrfarah@Josephs-MBP:[config

C++ : code explanation for method prototype with const = 0

我有一个类声明,其中有一段我不理解的代码:classWeapon{public:virtualvoidattack()const=0;};const=0部分是什么意思? 最佳答案 这是一个纯虚方法(=0),不应更改类(const)的数据。您应该在派生自Weapon的类之一中提供实现!看到这个:Differencebetweenavirtualfunctionandapurevirtualfunction您应该派生自Weapon(可以认为是接口(interface))具体类,例如Axe、Shotgun等。.您将在其中提供attack(

c++ - 错误 : ‘ostream’ does not name a type

我正在重载C++中的>运算符,但它无法编译。错误信息是:“error:‘ostream’doesnotnameatype”为什么会出现此错误?如何解决?#ifndefCOMPLEX_H#defineCOMPLEX_H#include//exit#include#includeclassComplex{public:Complex(void);Complex(doublea,doubleb);Complex(doublea);doublereal()const{returna;}doubleimag()const{returnb;}friendostream&operator>(istr

c# - Process.Start ("name.exe") - 如何找到 'name.exe'?

使用C#代码:Process.Start("name.exe");我想知道Process在哪里查找name.exe? 最佳答案 它将搜索当前工作目录、正在执行的exe的路径或%path%中的任何目录。 关于c#-Process.Start("name.exe")-如何找到'name.exe'?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/14375830/

c++ - 更新 visual studio 2017,现在出现编译错误 C7510 : 'Callback' : use of dependent template name must be prefixed with 'template'

我尝试在更新(15.8.0)后像往常一样编译我的项目。我将showincludes设置为yes以找出错误的来源,但它都是系统代码。从stdafx.cpp开始,它遍历所有包含和错误:1>Note:includingfile:C:\ProgramFiles(x86)\WindowsKits\10\Include\10.0.17134.0\shared\pshpack8.h1>Note:includingfile:C:\ProgramFiles(x86)\WindowsKits\10\Include\10.0.17134.0\shared\poppack.h1>Note:includingf

Windows .inf 文件 : how do I set the default Network Connection name during network driver install?

我正在尝试改编开源TAP-Win32driver对于我的项目。当它安装时(至少在Windows7上,我认为WindowsXP也是如此),它会在设备控制面板中创建一个名为“TAP-Win32AdapterV9”的设备。这很容易通过编辑OemWin2k.inffilethatcomeswithit来改变。.但是,该设备随后会连接到Windows网络浏览器中的网络,默认情况下它的名称类似于“本地连接2”。我可以使用GUI轻松重命名它:只需单击网络并按F2。但我的问题是:我正在处理的网络设备绝对不是“本地连接”,它实际上是一个虚拟网络设备。我该怎么做才能使名称​​默认使用我选择的更具描述性的名