Click here to Skip to main content
15,886,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSearch in *.chm File with C++? Pin
bosfan29-Jun-12 3:10
bosfan29-Jun-12 3:10 
AnswerRe: Search in *.chm File with C++? Pin
bosfan29-Jun-12 6:13
bosfan29-Jun-12 6:13 
Generalhelp about C++ STL container Pin
Falconapollo28-Jun-12 5:40
Falconapollo28-Jun-12 5:40 
GeneralRe: help about C++ STL container Pin
Chris Losinger28-Jun-12 6:11
professionalChris Losinger28-Jun-12 6:11 
GeneralRe: help about C++ STL container Pin
Falconapollo28-Jun-12 15:07
Falconapollo28-Jun-12 15:07 
GeneralRe: help about C++ STL container Pin
Maximilien28-Jun-12 7:27
Maximilien28-Jun-12 7:27 
GeneralRe: help about C++ STL container Pin
Falconapollo28-Jun-12 15:07
Falconapollo28-Jun-12 15:07 
GeneralRe: help about C++ STL container Pin
Aescleal28-Jun-12 8:41
Aescleal28-Jun-12 8:41 
How about abstracting the construction into a function as it's hard to grab the extra level of indirection using a vector constructor or an algorithm:
C++
std::vector<std::set<int>::iterator> build_index( const std::set<int> &s )
{
	std::vector< std::set<int>::iterator > index;

	for( auto iter( s.begin() ); iter != s.end(); ++iter )
	{
		index.push_back( iter );
	}

	return index;
}

int main()
{
	int set_initialisers[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
	std::set<int> s( std::begin( set_initialisers ), std::end( set_initialisers ) );

	std::vector< std::set<int>::iterator > index( build_index( s ) );
}
It's not that inefficient in C++98 as it'll probably trigger NRVO and in C++11 it'll use the move constructor for vector.
GeneralRe: help about C++ STL container Pin
Falconapollo28-Jun-12 15:08
Falconapollo28-Jun-12 15:08 
GeneralRe: help about C++ STL container Pin
Aescleal29-Jun-12 1:03
Aescleal29-Jun-12 1:03 
GeneralRe: help about C++ STL container Pin
Falconapollo29-Jun-12 16:18
Falconapollo29-Jun-12 16:18 
GeneralRe: help about C++ STL container Pin
Falconapollo29-Jun-12 16:25
Falconapollo29-Jun-12 16:25 
QuestionChange CBS_DROPDOWN on runtime ? Pin
_Flaviu28-Jun-12 4:31
_Flaviu28-Jun-12 4:31 
AnswerRe: Change CBS_DROPDOWN on runtime ? Pin
Albert Holguin28-Jun-12 5:32
professionalAlbert Holguin28-Jun-12 5:32 
GeneralRe: Change CBS_DROPDOWN on runtime ? Pin
_Flaviu28-Jun-12 6:01
_Flaviu28-Jun-12 6:01 
GeneralRe: Change CBS_DROPDOWN on runtime ? Pin
David Crow28-Jun-12 6:02
David Crow28-Jun-12 6:02 
AnswerRe: Change CBS_DROPDOWN on runtime ? Pin
Albert Holguin28-Jun-12 7:22
professionalAlbert Holguin28-Jun-12 7:22 
GeneralRe: Change CBS_DROPDOWN on runtime ? Pin
_Flaviu28-Jun-12 8:27
_Flaviu28-Jun-12 8:27 
GeneralRe: Change CBS_DROPDOWN on runtime ? Pin
Maximilien28-Jun-12 10:14
Maximilien28-Jun-12 10:14 
GeneralRe: Change CBS_DROPDOWN on runtime ? Pin
Albert Holguin28-Jun-12 11:12
professionalAlbert Holguin28-Jun-12 11:12 
QuestionCwinThread::INITINSTANCE Pin
ForNow28-Jun-12 2:54
ForNow28-Jun-12 2:54 
AnswerRe: CwinThread::INITINSTANCE Pin
Albert Holguin28-Jun-12 5:16
professionalAlbert Holguin28-Jun-12 5:16 
GeneralRe: CwinThread::INITINSTANCE Pin
ForNow28-Jun-12 7:37
ForNow28-Jun-12 7:37 
GeneralRe: CwinThread::INITINSTANCE Pin
Albert Holguin28-Jun-12 11:11
professionalAlbert Holguin28-Jun-12 11:11 
GeneralRe: CwinThread::INITINSTANCE Pin
ForNow28-Jun-12 13:03
ForNow28-Jun-12 13:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.