将C ++代码从结构迁移到类(migrating C++ code from structures to classes)
我正在将一些C ++代码从结构迁移到类。
我使用的结构主要用于位域优化,我不再需要它了(我现在比节省空间更担心速度)。
- 做这个迁移的一般准则是什么? 我仍然处于规划阶段,因为这是影响大部分代码的重大举措。 在做之前我想先计划一切。 我应该牢记的是什么?
I am migrating some C++ code from structures to classes.
I was using structures mainly for bit-field optimizations which I do not need any more (I am more worried about speed than saving space now).
- What are the general guidelines for doing this migration? I am still in the planning stage as this is a very big move affecting a major part of the code. I want to plan everything first before doing it. What are all the essential things I should keep in mind?
原文:https://stackoverflow.com/questions/2786581
最满意答案
错误说:Sonata \ MediaBundle \ Admin \ BaseMediaAdmin :: __ construct()中不存在参数5
所以,看一下sonata.media.admin.media服务配置中的参数。 只有4个参数。 你需要添加第5个。
在bundle config( https://github.com/sonata-project/SonataMediaBundle/blob/master/Resources/config/doctrine_orm_admin.xml )中,有5个参数:
<argument/> <argument>%sonata.media.admin.media.entity%</argument> <argument>%sonata.media.admin.media.controller%</argument> <argument type="service" id="sonata.media.pool"/> <argument type="service" id="sonata.media.manager.category" on-invalid="null"/>
所以,我认为你可以添加@ sonata.media.manager.category作为第五个参数。
The error say : Argument 5 doesn't exist in Sonata\MediaBundle\Admin\BaseMediaAdmin::__construct()
So, look at arguments in you sonata.media.admin.media service configuration. There are only 4 arguments. You need to add the 5th.
In bundle config (https://github.com/sonata-project/SonataMediaBundle/blob/master/Resources/config/doctrine_orm_admin.xml), there are 5 arguments :
<argument/> <argument>%sonata.media.admin.media.entity%</argument> <argument>%sonata.media.admin.media.controller%</argument> <argument type="service" id="sonata.media.pool"/> <argument type="service" id="sonata.media.manager.category" on-invalid="null"/>
So, I think you can add @sonata.media.manager.category as 5th argument.
相关问答
更多-
接得好。 这看起来可能是C#编译器中的一个错误 - 我会ping Eric Lippert看看他的想法。 ( dynamic可以有点诡异;这可能是一个非常好的但不明显的原因)。 编辑: 下面的代码完全没有起作用。 我可以宣誓就职,今天早上我有工作,我很困惑,发生了什么事情。 根据Simon的评论,该代码失败,并显示一条消息,表示该语言不支持该消息。 请注意,如果您使用显式接口实现,似乎编译正常: // Doesn't actually compile - see edit above class MyInt ...
-
它不起作用,因为您试图从静态上下文访问非静态(即实例)方法。 为了调用它,你需要一个Solution类的实例(请注意,在你的工作代码中你有一个ex class的实例,所以在这里你需要做同样的细微差别): Solution instance = new Solution(); instance.prnt(); It's not working, because you're trying to access non-static (i.e. instance) method from a static co ...
-
除了在“溢出”中出现错误外,它看起来像是在尝试将public访问修饰符应用于显式接口成员实现。 您可以将该成员隐式实现为公共成员,也可以显式实现,但不能同时实现。 隐式实现: public void OnOverflow(object vtEvent, PISDK.OverflowCauseConstants Cause) { throw new NotImplementedException(); } 显式实现: void PISDK._DEventPipeEvents.OnOverfl ...
-
错误说:Sonata \ MediaBundle \ Admin \ BaseMediaAdmin :: __ construct()中不存在参数5 所以,看一下sonata.media.admin.media服务配置中的参数。 只有4个参数。 你需要添加第5个。 在bundle config( https://github.com/sonata-project/SonataMediaBundle/blob/master/Resources/config/doctrine_orm_admin.xml )中, ...
-
您需要实现位于界面中的确切函数(具有相同数量的输入参数)。 所以在你的情况下,将你的界面更改为: interface Figura { String Perimetar(int a, int b, int c) String Plostina(int a, int b, int c) } 或者将实现更改为没有参数的函数。 You need to implement the exact functions that sit in the interface(with the same numbe ...
-
UserType::__construct方法签名在这里有两个参数,并且您只在服务声明( $doctrine )中传递一个,因此出错。 如果你仍然需要表单类型中的Doctrine,你也应该传递它: user.form.token: class: UserBundle\Form\UserType arguments: ['@doctrine', '@security.token_storage'] tags: - { name: form.type } 此外,看起来你没有正确创建表单本身 ...
-
假设您的services.yml文件正在加载并且您复制粘贴在内容中,那么您有一个简单的拼写错误: # services.yml class: ApxDev\UsersBundle\Form\ProductType should be class: ApxDev\UsersBundle\Form\ProductsType Assuming your services.yml file is being loaded and that you copied pasted in the contents the ...
-
没有实现接口成员(does not implement interface member)[2023-02-12]
您的类GetVenues未实现错误消息中提到的方法。 你到底在哪里? GetVenuesByLocation(string search)在Venue类中定义。 我注意到这个问题开始引起人们的兴趣。 这里的问题很简单:你的类没有实现(即使它是abstract ,你必须定义它们)接口中定义的所有方法。 您的IDE应该在编译之前警告您。 Your class GetVenues does not implement the method mentioned in your error message. Wher ... -
目前,RealmObjects不支持实现Parcable,并且仅当接口为空或者包含否则将生成的getter和setter方法时,才支持接口。 对于Parcable,您可以考虑使用Parceler: https ://realm.io/docs/java/latest/#parceler 否则我们在这里跟踪问题: https : //github.com/realm/realm-java/issues/878 一旦我们实现了对自定义方法的支持,通常可以支持接口,可以在这里跟踪: https : //githu ...
-
首先,在看到此行时进行更改 var/cache/prod/appProdProjectContainer.php 始终考虑删除var / cache / prod文件夹,并根据您的缓存设置和/或更改的文件,重新启动apache。 或者,只需使用开发环境,因为它的目的是让您的开发生活更轻松,尽管速度要慢得多。 First, after making changes whenever you see this line var/cache/prod/appProdProjectContainer.php A ...