Click here to Skip to main content
15,796,333 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 4:09
cofounderChris Maunder16-Jul-09 4:09 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Jul-09 4:05
cofounderChris Maunder16-Jul-09 4:05 
QuestionAI Pin
Ted Snyders18-Nov-23 10:52
Ted Snyders18-Nov-23 10:52 
AnswerRe: AI Pin
RedDk18-Nov-23 15:44
RedDk18-Nov-23 15:44 
QuestionHelp with STL list::insert Pin
ForNow21-Sep-22 2:54
ForNow21-Sep-22 2:54 
AnswerRe: Help with STL list::insert Pin
Graham Breach21-Sep-22 22:40
Graham Breach21-Sep-22 22:40 
GeneralRe: Help with STL list::insert Pin
ForNow22-Sep-22 2:35
ForNow22-Sep-22 2:35 
GeneralRe: Help with STL list::insert Pin
Graham Breach22-Sep-22 4:40
Graham Breach22-Sep-22 4:40 
GeneralRe: Help with STL list::insert Pin
ForNow22-Sep-22 5:31
ForNow22-Sep-22 5:31 
GeneralRe: Help with STL list::insert Pin
Graham Breach22-Sep-22 5:59
Graham Breach22-Sep-22 5:59 
GeneralRe: Help with STL list::insert Pin
ForNow22-Sep-22 6:11
ForNow22-Sep-22 6:11 
AnswerRe: Help with STL list::insert Pin
Richard MacCutchan22-Sep-22 5:51
mveRichard MacCutchan22-Sep-22 5:51 
GeneralRe: Help with STL list::insert Pin
ForNow22-Sep-22 10:30
ForNow22-Sep-22 10:30 
GeneralRe: Help with STL list::insert Pin
Richard MacCutchan22-Sep-22 23:28
mveRichard MacCutchan22-Sep-22 23:28 
GeneralRe: Help with STL list::insert Pin
ForNow23-Sep-22 2:45
ForNow23-Sep-22 2:45 
GeneralRe: Help with STL list::insert Pin
Richard MacCutchan23-Sep-22 2:55
mveRichard MacCutchan23-Sep-22 2:55 
GeneralRe: Help with STL list::insert Pin
ForNow23-Sep-22 3:20
ForNow23-Sep-22 3:20 
GeneralRe: Help with STL list::insert Pin
Richard MacCutchan23-Sep-22 4:16
mveRichard MacCutchan23-Sep-22 4:16 
GeneralRe: Help with STL list::insert Pin
ForNow23-Sep-22 5:11
ForNow23-Sep-22 5:11 
GeneralRe: Help with STL list::insert Pin
Richard MacCutchan23-Sep-22 5:38
mveRichard MacCutchan23-Sep-22 5:38 
GeneralRe: Help with STL list::insert Pin
ForNow23-Sep-22 5:48
ForNow23-Sep-22 5:48 
QuestionMessage Closed Pin
19-Jul-22 6:14
Member 1496877119-Jul-22 6:14 
AnswerRe: error: cannot call member function ‘bool QRegExp::exactMatch(const QString&) const’ without object Pin
jsc4219-Jul-22 7:35
professionaljsc4219-Jul-22 7:35 
Question/std:c++20 broke a template class Pin
Member 1567106212-Jun-22 11:07
Member 1567106212-Jun-22 11:07 
Hi -

I have a template array class based on a std::vector. All worked well w/ c++17, but there is one line I can't seem to port to the new standard. I'm trying to acquire an iterator to the underlying vector.

Any advice is greatly appreciated.

An abbreviated depiction:
C++
template <class Type> class CMy_Array 
{

    private:
		std::vector<Type> m_vItems;

	public:

		CMy_Array()
		{
		}
		virtual ~CMy_Array ()
		{
			m_vItems.clear();
		}
        void InsertAt(int index)
        {

       	//	THE LINE IN QUESTION - trying to acquire an iterator...
        // this worked w/ std:c++17   -

            std::vector<Type>::iterator p =  m_vItems.begin();

        // With c++20, 2 errors occur; 
        // C2760 - syntax error: unexpected token 'identifier', expected ';' , and 
        // C7510 - 'iterator': use of dependent type name must be prefixed with 'typename'

        // Using the documentation for C2760, I modified the line in question as so -

    		std::vector<Type>::iterator p =  static_cast <std::vector<Type>::iterator> m_vItems.begin();

        // This eliminated the C7510 error, but C2760 remains.


        }      
}

AnswerRe: /std:c++20 broke a template class Pin
longjmp24-Nov-22 3:59
longjmp24-Nov-22 3:59 

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.