Hi,


These days, I want to use ITK 4.4.2. When I compiled the code by using VS2010, 
it was OK. But, when I used VS2012, there was an error which said 
'InsightApplications\MRIBiasCorrection\OptionList.cxx(37): error C2664: 
'std::make_pair' : cannot convert parameter 1 from 'std::string' to 'const 
std::string &&'' and 'You cannot bind an lvalue to an rvalue reference'. 
Firstly I wanted to find the answer of this problem by using Google, but I 
cann't get anything. Then I found a similar problem on the page 
'http://connect.microsoft.com/VisualStudio/feedback/details/691756/std-make-pair-error-in-vc11'.
 I followed the answer, and revised the code, then the it worked very well. 



And I use the following codes for test, if you use VS2010, it will work well. 
But, there will be an error if you use VS 2012. 



#include<string>
#include<utility>
#include<iostream>
using namespace std;

int main() {
 string ht = "hello";
 pair<double,string> ps;
 ps = make_pair<int,string>(1,ht);

 int index = 1 ;
 char* argv[] = {"A","B"};
 std::string tag ;

 const std::string value = argv[index] ;
 
 std::make_pair<const std::string, std::string>(tag, value) ;//zjf

 cout << ps.first << " " << ps.second << endl;
 return 0;
}



I hope this can help someone who uses the VS2012 to bind VTK 4.4.2.

发自 Windows 邮件
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers

Reply via email to