<html><head><style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head><body><div data-externalstyle="false" dir="ltr" style="font-family:'Microsoft YaHei UI',Calibri,'Segoe UI',Meiryo,'Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:12pt;"><div><span style="color: rgb(0, 0, 0);"><font color="#2a2a2a">Hi,</font></span></div><div><span style="color: rgb(0, 0, 0);"><font color="#2a2a2a"></font></span> </div><div><font color="#2a2a2a"><span style="color: rgb(0, 0, 0);">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\</span><span style="color: rgb(0, 0, 0);">MRIBiasCorrection</span><span style="color: rgb(0, 0, 0);">\OptionList.cxx(37): error C2664: 'std::</span><span style="color: rgb(0, 0, 0);">make_pair</span><span style="color: rgb(0, 0, 0);">' : cannot convert parameter 1 from 'std::string' to 'const std::string &&'' and 'You cannot bind an lvalue to an </span><span style="color: rgb(0, 0, 0);">rvalue</span><span style="color: rgb(0, 0, 0);"> reference'. Firstly I wanted to find the answer of this problem by using Google, but I </span><span style="color: rgb(0, 0, 0);">cann</span><span style="color: rgb(0, 0, 0);">'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 </span><span style="color: rgb(0, 0, 0);">code, then</span><span style="color: rgb(0, 0, 0);"> the it worked very well.</span>
</font></div><div><font color="#2a2a2a"></font> </div><p style="margin: 0px; text-indent: 0px; -qt-block-indent: 0;"><font color="#2a2a2a"><span style="color: rgb(0, 0, 0);">And I use the following codes for test, if you use VS2010, it will work well. </span><span style="color: rgb(128, 0, 182);"><font color="#2a2a2a">But, there will be an error if you use VS 2012. </font></span></font></p><p style="margin: 0px; text-indent: 0px; -qt-block-indent: 0;"><span style="color: rgb(128, 0, 182);"></span> </p><p style="margin: 0px; text-indent: 0px; -qt-block-indent: 0;"><span style="color: rgb(128, 0, 182);">#include<string><br>#include<utility><br>#include<iostream><br>using namespace std;</span></p><p style="margin: 0px; text-indent: 0px; -qt-block-indent: 0;"><span style="color: rgb(128, 0, 182);">int main() {<br> string ht = "hello";<br> pair<double,string> ps;<br> ps = make_pair<int,string>(1,ht);</span></p><p style="margin: 0px; text-indent: 0px; -qt-block-indent: 0;"><span style="color: rgb(128, 0, 182);"> int index = 1 ;<br> char* argv[] = {"A","B"};<br> std::string tag ;</span></p><p style="margin: 0px; text-indent: 0px; -qt-block-indent: 0;"><span style="color: rgb(128, 0, 182);"> const std::string value = argv[index] ;<br> <br> std::make_pair<const std::string, std::string>(tag, value) ;//zjf</span></p><p style="margin: 0px; text-indent: 0px; -qt-block-indent: 0;"><span style="color: rgb(128, 0, 182);"> cout << ps.first << " " << ps.second << endl;<br> return 0;<br>}</span></p><div data-signatureblock="true"><div> </div><div><span style="color: rgb(128, 0, 182);"><font color="#2a2a2a">I hope this can help someone who uses the VS2012 to bind VTK 4.4.2.</font></span></div><div>发自 Windows 邮件</div><div> </div></div></div></body></html>