其實這是早已踩過的 bug, 單純留著當紀錄.
int i = 0;
( [&i]() {
// capture once
++i;
( [&i]() {
// capture twice
++i;
} )();
} )();
std::cout << i << std::endl; // 2
來猜猜看上述程式用哪個 compiler 會出錯?
int i = 0;
( [&i]() {
// capture once
++i;
( [&i]() {
// capture twice
++i;
} )();
} )();
std::cout << i << std::endl; // 2
auto f( std::bind( []( int a, int b )->int {
return a + b;
}, std::placeholders::_1, 2 ) );
f( 1 ); // returns 3
# aptitude install mozplugger
$ DISPLAY= im-switch -c這個方法會讓 im-switch 以為目前沒有 X Server,從而使用傳統的設定方式。現在你可以享受你的文字介面了。
const char * fromURI( const QUrl & uri ) {
QByteArray tmp( uri.toString().toUtf8() );
#ifdef Q_OS_WIN
if( uri.scheme() == "file" ) {
tmp.prepend( 'w' );
}
#endif
return tmp;
}
-mp 的選項, 顧名思義, 加上之後它就會針對 msvc 開啟 /MP 參數. 在此統整一下我用的參數:
@echo off
SET PREFIX=Z:\Qt\4.7.1
configure ^
-opensource ^
-debug-and-release ^
-mp ^
-ltcg ^
-fast ^
-no-qt3support ^
-no-dsp ^
-no-vcproj ^
-prefix %PREFIX% ^
-nomake examples ^
-nomake demos ^
-nomake translations
MKDIR %PREFIX%\mkspecs
XCOPY /E /K mkspecs\* %PREFIX%\mkspecs
nmake
nmake install
nmake clean