我收到了这两个警告(在MacOSX上使用GCC 4.2):
/Users/az/Programmierung/openlierox/build/Xcode/../../src/main.cpp:154:0 /Users/az/Programmierung/openlierox/build/Xcode/../../src/main .cpp:154:警告:'startMainLockDetector():: MainLockDetector'声明的可见性高于其字段'startMainLockDetector():: MainLockDetector :: <anonymous>'的类型
/Users/az/Programmierung/openlierox/build/Xcode/../../src/main.cpp:154:0 /Users/az/Programmierung/openlierox/build/Xcode/../../src/main .cpp:154:警告:声明'startMainLockDetector():: MainLockDetector'的可见性高于其基数'Action'
在这段代码中:
struct Action {
virtual ~Action() {}
virtual int handle() = 0;
};
static void startMainLockDetector() {
/* ... */
struct MainLockDetector : Action {
bool wait(Uint32 time) { /* ... */ }
int handle() { /* ... */ }
};
/* ... */
}
Run Code Online (Sandbox Code Playgroud)
我不确定这些警告意味着什么(能见度?)以及如何解决它们.(我真的希望类MainLockDetector只对该函数是本地的.)
我已经与许多其他编译器(clang,GCC 3.*,GCC 4.0,GCC 4.4等)编译了相同的代码,并且从未对此代码发出任何警告.
对于其中一种解决方案,当我在解决方案资源管理器和构建菜单中右键单击解决方案名称时,在上下文菜单中都没有看到“清理解决方案”选项。当我对项目进行任何更改和调试时,VS 永远不会命中断点,并且我得到“当前不会命中断点。源代码与原始版本不同。” 信息。我的理解是我需要清理溶液。
对于其他解决方案,我确实看到了 Clean 解决方案,但我没有遇到同样的问题。
我仍然是Android的新手,我在创建一个有两个背景的布局时遇到了麻烦,这个布局在x方向但不是y.
我嘲笑了我在这里要创造的东西......
http://img153.imageshack.us/img153/6008/cnbackground.png
所以顶部重复水平,然后在中间有一个平坦的屏幕部分,我将在其中心,然后在底部有一些水平重复的草.
以前有人试过这样的事吗?
乔恩
我已经将VS2010与Resharper 5一起使用了几个星期,并且遇到了性能问题.有时键入时,光标会滞后,键盘不会立即显示.此外,滚动有时会滞后.
有一个论坛线程启动,JetBrains一直在响应.几个人(包括我自己)添加了他们的声音并上传了一些性能配置文件.
如果这里的任何人有这个问题,我会鼓励你访问该主题并让JetBrains了解它.
有没有人有这个问题,并有建议恢复性能?
这可能是一个愚蠢的问题,但我在文档中找不到答案.弹出键盘上的"完成"按钮是否总是导致键盘消失?我在网上看到了很多像这样的代码:
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
[theTextField resignFirstResponder];
return YES;
}
Run Code Online (Sandbox Code Playgroud)
当我按下"完成"按钮时,键盘弹出并重新UITextField响应第一响应者.
我假定按"完成"按钮没用过引起UITextField来resignFirstResponder,但这种行为在一段时间内改变.
我正在调试OS 3.0 - 3.1.3
this关键字的目的是什么?类中的方法是否可以访问同一个类中的其他对等成员?this在类中调用一个调用peer方法的需要是什么?
我想知道是否有任何一般的指导方针,一般程序员和QA特别遵循建立一个干净的测试系统.
系统应该每天都是干净的,没有任何不必要的依赖(例如.NET),没有先前安装和测试的重影,并且相当容易成像和更改.
任何提示将非常感谢!
我需要的是一个类似于shutdownNow的方法,但是,之后能够提交新的任务.我的ThreadPoolExecutor将在程序执行期间接受随机数量的任务.
谁能告诉我们这里发生了什么?当我尝试调试代码,当控件处于线程()函数在15行,它跳过了第16行移动到第17行并返回线16为什么不是由线动线?
1. #include <boost/thread.hpp>
2. #include <iostream>
3.
4. void wait(int seconds)
5. {
6. boost::this_thread::sleep(boost::posix_time::seconds(seconds));
7. }
8.
9. boost::mutex mutex;
10.
11. void thread()
12. {
13. for (int i = 0; i < 5; ++i)
14. {
15. wait(1);
16. mutex.lock();
17. std::cout << "Thread " << boost::this_thread::get_id() << ": " << i << std::endl;
18. mutex.unlock();
19. }
20. }
21.
22. int main()
23. {
24. boost::thread t1(thread);
25. boost::thread t2(thread);
26. t1.join();
27. t2.join(); …Run Code Online (Sandbox Code Playgroud) 我已经开始尝试使用boost python并遇到问题.我试图将一个C++类暴露给python,这没有任何问题.但我似乎无法实现__str__类的功能而不会出现我不明白的构建错误.
我正在使用boostpro的boost 1_42 prebuild.我使用cmake和vs2010编译器构建库.
我有一个非常简单的设置.头文件(tutorial.h)如下所示:
#include <iostream>
namespace TestBoostPython{
class TestClass {
private:
double m_x;
public:
TestClass(double x);
double Get_x() const;
void Set_x(double x);
};
std::ostream &operator<<(std::ostream &ostr, const TestClass &ts);
};
Run Code Online (Sandbox Code Playgroud)
和相应的cpp文件看起来像:
#include <boost/python.hpp>
#include "tutorial.h"
using namespace TestBoostPython;
TestClass::TestClass(double x)
{
m_x = x;
}
double TestClass::Get_x() const
{
return m_x;
}
void TestClass::Set_x(double x)
{
m_x = x;
}
std::ostream &operator<<(std::ostream &ostr, const TestClass &ts)
{
ostr << ts.Get_x() << "\n";
return ostr;
} …Run Code Online (Sandbox Code Playgroud) c++ ×3
android ×1
asp.net ×1
boost ×1
boost-python ×1
cocoa-touch ×1
environment ×1
gcc ×1
gcc-warning ×1
iphone ×1
java ×1
keyboard ×1
objective-c ×1
performance ×1
pointers ×1
python ×1
qa ×1
resharper ×1
task ×1
testing ×1
this ×1
threadpool ×1
uikit ×1
visibility ×1
warnings ×1