<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800169</guid>
        <pubDate>Mon, 27 May 2019 15:18:03 +0000</pubDate>
        <title>Странная линковка шаблонов</title>
        <link>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800169</link>
        <description><![CDATA[Qraizer: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::Queue(int number) : maxsize(number)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;queue = new Data[number];</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;elemCT = 0;</div><div class="code_line">};</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>Qraizer</author>
        <category>C/C++: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800164</guid>
        <pubDate>Mon, 27 May 2019 13:28:55 +0000</pubDate>
        <title>Странная линковка шаблонов</title>
        <link>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800164</link>
        <description><![CDATA[Олег М: Перенёс всё правильно. Это ошибки в твоём коде, исправляй <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2019-05-27T13:30:52+00:00">27.05.19, 13:30</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=414908&view=findpost&p=3800163'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>VictorSh &#064; <time class="tag-quote__quoted-time" datetime="2019-05-27T13:20:21+00:00">27.05.19, 13:20</time></span><div class='quote '>d:&#092;programming&#092;templat&#092;queue.h(40) : error C2758: &#39;maxsize&#39; : must be initialized in constructor base/member initializer list</div></div><br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::Queue&#60;Data&#62;(int number)</div><div class="code_line">: begin(0)</div><div class="code_line">, end(0)</div><div class="code_line">, elemCT(0)</div><div class="code_line">, maxsize(number)</div><div class="code_line">, queue(new* Data[number])</div><div class="code_line">{</div><div class="code_line">};</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2019-05-27T13:36:27+00:00">27.05.19, 13:36</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=414908&view=findpost&p=3800163'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>VictorSh &#064; <time class="tag-quote__quoted-time" datetime="2019-05-27T13:20:21+00:00">27.05.19, 13:20</time></span><div class='quote '>d:&#092;programming&#092;templat&#092;queue.h(41) : error C2166: l-value specifies const object</div></div><br>
У тебя maxsize объявлен как const, а те ему пытаешься присвоить значение maxsize = obj.maxsize; очевидно в твоём операторе = либо этого делать не нужно, либо нужно убрать у него const и выделять новый буфер с новым maxsize<br>
<br>
И т.д. и т.п.]]></description>
        <author>Олег М</author>
        <category>C/C++: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800163</guid>
        <pubDate>Mon, 27 May 2019 13:20:21 +0000</pubDate>
        <title>Странная линковка шаблонов</title>
        <link>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800163</link>
        <description><![CDATA[VictorSh: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=414908&view=findpost&p=3800161'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Олег М &#064; <time class="tag-quote__quoted-time" datetime="2019-05-27T12:20:27+00:00">27.05.19, 12:20</time></span><div class='quote '>Покажи, как перенёс и ошибки </div></div><br>
<br>
Файл main.cpp<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">#include &quot;queue.h&quot;</div><div class="code_line">&nbsp;</div><div class="code_line">int main()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue &#60;int&#62; a(10);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;return 0;</div><div class="code_line">}</div></ol></div></div></div></div><br>
<br>
Файл queue.h<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">#include &#60;string.h&#62;</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; class Queue</div><div class="code_line">{</div><div class="code_line">public:</div><div class="code_line">&nbsp;&nbsp; &nbsp;//êîíñòðóêòîðû</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue();</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue(int number);</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue(Queue &amp;obj);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;bool IsEmpty(); // ïðîâåðêà, ïóñòàÿ ëè î÷åðåäü.</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetBuffer(Queue obj);</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetBegin();</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetEnd();</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetCountElements();</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetCurrentCount();</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;//ïåðåãðóæåííûå îïåðàòîðû</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue&amp; operator = &nbsp;(const Queue &amp;obj); //</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue&amp; operator + &nbsp;(const Data &amp;obj);</div><div class="code_line">&nbsp;&nbsp; &nbsp;Data &nbsp;operator - &nbsp;();</div><div class="code_line">&nbsp;&nbsp; &nbsp;//äåñòðóêòîð</div><div class="code_line">&nbsp;&nbsp; &nbsp;~Queue();</div><div class="code_line">&nbsp;</div><div class="code_line">protected:</div><div class="code_line">&nbsp;&nbsp; &nbsp;int begin, &nbsp; &nbsp; &nbsp; // íà÷àëî î÷åðåäè</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;end; &nbsp; &nbsp; &nbsp; &nbsp; // êîíåö î÷åðåäè</div><div class="code_line">&nbsp;&nbsp; &nbsp;int elemCT; &nbsp; &nbsp; //êîë-âî ýë-òîâ â äàííûé ìîìåíò</div><div class="code_line">&nbsp;&nbsp; &nbsp;const int maxsize; // ðàçìåð î÷åðåäè</div><div class="code_line">&nbsp;&nbsp; &nbsp;Data* queue;</div><div class="code_line">};</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::Queue()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">};</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::Queue&#60;Data&#62;(int number)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;maxsize = number;</div><div class="code_line">&nbsp;&nbsp; &nbsp;queue = new* Data[number];</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;elemCT = 0;</div><div class="code_line">};</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::Queue(Queue&#60;Data&#62; &amp;obj)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;maxsize = obj.GetCountElements();</div><div class="code_line">&nbsp;&nbsp; &nbsp;obj.GetPointers(begin, end);</div><div class="code_line">&nbsp;&nbsp; &nbsp;elemCT = obj.GetCurrentCount();</div><div class="code_line">&nbsp;&nbsp; &nbsp;queue = new* Data[maxsize];</div><div class="code_line">&nbsp;&nbsp; &nbsp;obj.GetBuffer(queue);</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">//äåñòðóêòîð</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::~Queue()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (queue)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;delete[] queue;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">//îïåðàòîð ïðèñâàèâàíèÿ(êîïèðîâàíèÿ)</div><div class="code_line">template &nbsp;&#60;class Data&#62; Queue&#60;Data&#62;&amp; Queue&#60;Data&#62;::operator = (const Queue&#60;Data&#62; &amp;obj)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;maxsize = obj.maxsize;</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin = obj.begin;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end = obj.end;</div><div class="code_line">&nbsp;&nbsp; &nbsp;elemCT = obj.elemCT;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;memcpy(this-&#62;queue, obj.queue, sizeof(Data)*maxsize);</div><div class="code_line">&nbsp;&nbsp; &nbsp;return *this;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetBuffer(Queue&#60;Data&#62; obj)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;memcpy(obj, this-&#62;queue, sizeof(Data)*maxsize)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return 0;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetBegin()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;return this-&#62;begin;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetEnd()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;return this-&#62;end;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetCountElements()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;return this-&#62;maxsize;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetCurrentCount()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;return this-&#62;elemCT;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; bool Queue&#60;Data&#62;::IsEmpty()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (this-&#62;elemCT)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return true;</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return false;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;&amp; Queue&#60;Data&#62;::operator + (const Data &amp;obj)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (elemCT &#60; maxsize)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;queue[elemCT] = obj;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;elemCT++;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;end++;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;memcpy(queue[0], queue[1], sizeof(Data)*(elemCT - 1));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;elemCT = maxsize;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;queue[maxsize - 1] = obj;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;return *this;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Data Queue&#60;Data&#62;::operator - &nbsp;()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;Data temp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;temp = queue[0];</div><div class="code_line">&nbsp;&nbsp; &nbsp;memcpy(queue[0], queue[1], sizeof(Data)*(elemCT - 1));</div><div class="code_line">&nbsp;&nbsp; &nbsp;elemCT--;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end--;</div><div class="code_line">&nbsp;&nbsp; &nbsp;return temp;</div><div class="code_line">}</div></ol></div></div></div></div><br>
<br>
Вывод компилятора:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">--------------------Configuration: templat - Win32 Debug--------------------</div><div class="code_line">Compiling...</div><div class="code_line">Main.cpp</div><div class="code_line">d:\programming\templat\queue.h(40) : error C2758: &#39;maxsize&#39; : must be initialized in constructor base/member initializer list</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;d:\programming\templat\queue.h(30) : see declaration of &#39;maxsize&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(41) : error C2166: l-value specifies const object</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(42) : error C2059: syntax error : &#39;*&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : error C2143: syntax error : missing &#39;;&#39; before &#39;}&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">d:\programming\templat\queue.h(46) : fatal error C1003: error count exceeds 100; stopping compilation</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;D:\PROGRAMMING\templat\Main.cpp(9) : while compiling class-template member function &#39;__thiscall Queue&#60;int&#62;::Queue&#60;int&#62;(int)&#39;</div><div class="code_line">Error executing cl.exe.</div><div class="code_line">&nbsp;</div><div class="code_line">templat.exe - 102 error(s), 0 warning(s)</div></ol></div></div></div></div>]]></description>
        <author>VictorSh</author>
        <category>C/C++: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800161</guid>
        <pubDate>Mon, 27 May 2019 12:20:27 +0000</pubDate>
        <title>Странная линковка шаблонов</title>
        <link>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800161</link>
        <description><![CDATA[Олег М: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=414908&view=findpost&p=3800160'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>VictorSh &#064; <time class="tag-quote__quoted-time" datetime="2019-05-27T12:13:13+00:00">27.05.19, 12:13</time></span><div class='quote '>Да, переносил, не помогло </div></div><br>
Покажи, как перенёс и ошибки]]></description>
        <author>Олег М</author>
        <category>C/C++: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800160</guid>
        <pubDate>Mon, 27 May 2019 12:13:13 +0000</pubDate>
        <title>Странная линковка шаблонов</title>
        <link>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800160</link>
        <description><![CDATA[VictorSh: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=414908&view=findpost&p=3800131'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Олег М &#064; <time class="tag-quote__quoted-time" datetime="2019-05-27T07:20:04+00:00">27.05.19, 07:20</time></span><div class='quote '>Перенеси содержимое queue.cpp в queue.h</div></div><br>
Да, переносил, не помогло :(]]></description>
        <author>VictorSh</author>
        <category>C/C++: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800132</guid>
        <pubDate>Mon, 27 May 2019 07:30:55 +0000</pubDate>
        <title>Странная линковка шаблонов</title>
        <link>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800132</link>
        <description><![CDATA[Dushevny: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=414908&view=findpost&p=3800126'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>VictorSh &#064; <time class="tag-quote__quoted-time" datetime="2019-05-27T03:07:06+00:00">27.05.19, 03:07</time></span><div class='quote '>В чем может быть проблема?</div></div>Вам надо все содержимое queue.cpp перенести в queue.h Когда компилятор обрабатывает ваш queue.cpp он понятия не имеет, для каких Data этот шаблон будет использоваться и никакого кода не генерит. Когда он обрабатывает ваш main.cpp - он не имеет реализации шаблона и поэтому думает, что реализация функций-членов queue&lt;int&gt; у вас где-то явно присутствует. А ее нет.]]></description>
        <author>Dushevny</author>
        <category>C/C++: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800131</guid>
        <pubDate>Mon, 27 May 2019 07:20:04 +0000</pubDate>
        <title>Странная линковка шаблонов</title>
        <link>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800131</link>
        <description><![CDATA[Олег М: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=414908&view=findpost&p=3800126'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>VictorSh &#064; <time class="tag-quote__quoted-time" datetime="2019-05-27T03:07:06+00:00">27.05.19, 03:07</time></span><div class='quote '>В чем может быть проблема? Заранее спасибо.</div></div><br>
Все шабонные функции должны бать в h-файлах. Перенеси содержимое queue.cpp в queue.h]]></description>
        <author>Олег М</author>
        <category>C/C++: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800126</guid>
        <pubDate>Mon, 27 May 2019 03:07:06 +0000</pubDate>
        <title>Странная линковка шаблонов</title>
        <link>https://forum.sources.ru/index.php?showtopic=414908&amp;view=findpost&amp;p=3800126</link>
        <description><![CDATA[VictorSh: Здравствуйте,<br>
пишу шаблон и столкнулся с проблемой линковки<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><br>
Linking...<br>
Main.obj : error LNK2001: unresolved external symbol &quot;public: __thiscall Queue&lt;int&gt;::~Queue&lt;int&gt;(void)&quot; (??1?&#036;Queue@H@@QAE@XZ)<br>
Main.obj : error LNK2001: unresolved external symbol &quot;public: __thiscall Queue&lt;int&gt;::Queue&lt;int&gt;(int)&quot; (??0?&#036;Queue@H@@QAE@H@Z)<br>
Debug/templat.exe : fatal error LNK1120: 2 unresolved externals<br>
</div></div><br>
<br>
Реализовал шаблон в cpp файле (пробовал также все сделать в одном h файле - эффект тот же). Сделаны конструктор и деструктор и все равно линкер ругается этой ошибкой. Вроде как это значит, что функция объявлена, но не реализована, но она у меня есть&#33;<br>
Пробовал в Visual Studio c++ 6, Studio 2013 и 2017<br>
<br>
В чем может быть проблема? Заранее спасибо.<br>
<br>
Main.cpp<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">#include &quot;queue.h&quot;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">int main()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue &#60;int&#62; a(10);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;return 0;</div><div class="code_line">}</div></ol></div></div></div></div><br>
<br>
queue.h<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">template &#60;class Data&#62;</div><div class="code_line">class Queue</div><div class="code_line">{</div><div class="code_line">public:</div><div class="code_line">&nbsp;&nbsp; &nbsp;//êîíñòðóêòîðû</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue();</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue(int number);</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue(Queue &amp;obj);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;bool IsEmpty(); // ïðîâåðêà, ïóñòàÿ ëè î÷åðåäü.</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetBuffer(Queue obj);</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetBegin();</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetEnd();</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetCountElements();</div><div class="code_line">&nbsp;&nbsp; &nbsp;int GetCurrentCount();</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;//ïåðåãðóæåííûå îïåðàòîðû</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue&amp; operator = &nbsp;(const Queue &amp;obj); //</div><div class="code_line">&nbsp;&nbsp; &nbsp;Queue&amp; operator + &nbsp;(const Data &amp;obj);</div><div class="code_line">&nbsp;&nbsp; &nbsp;Data &nbsp;operator - &nbsp;();</div><div class="code_line">&nbsp;&nbsp; &nbsp;//äåñòðóêòîð</div><div class="code_line">&nbsp;&nbsp; &nbsp;~Queue();</div><div class="code_line">&nbsp;</div><div class="code_line">protected:</div><div class="code_line">&nbsp;&nbsp; &nbsp;int begin, &nbsp; &nbsp; &nbsp; // íà÷àëî î÷åðåäè</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;end; &nbsp; &nbsp; &nbsp; &nbsp; // êîíåö î÷åðåäè</div><div class="code_line">&nbsp;&nbsp; &nbsp;int elemCT; &nbsp; &nbsp; //êîë-âî ýë-òîâ â äàííûé ìîìåíò</div><div class="code_line">&nbsp;&nbsp; &nbsp;const int maxsize; // ðàçìåð î÷åðåäè</div><div class="code_line">&nbsp;&nbsp; &nbsp;Data* queue;</div><div class="code_line">};</div></ol></div></div></div></div><br>
<br>
queue.cpp<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">#include &quot;queue.h&quot;</div><div class="code_line">#include &#60;string.h&#62;</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::Queue()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">};</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::Queue&#60;Data&#62;(int number)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;maxsize = number;</div><div class="code_line">&nbsp;&nbsp; &nbsp;queue = new* Data[number];</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;elemCT = 0;</div><div class="code_line">};</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::Queue(Queue&#60;Data&#62; &amp;obj)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;maxsize = obj.GetCountElements();</div><div class="code_line">&nbsp;&nbsp; &nbsp;obj.GetPointers(begin, end);</div><div class="code_line">&nbsp;&nbsp; &nbsp;elemCT = obj.GetCurrentCount();</div><div class="code_line">&nbsp;&nbsp; &nbsp;queue = new* Data[maxsize];</div><div class="code_line">&nbsp;&nbsp; &nbsp;obj.GetBuffer(queue);</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">//äåñòðóêòîð</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;::~Queue()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (queue)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;delete[] queue;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">//îïåðàòîð ïðèñâàèâàíèÿ(êîïèðîâàíèÿ)</div><div class="code_line">template &nbsp;&#60;class Data&#62; Queue&#60;Data&#62;&amp; Queue&#60;Data&#62;::operator = (const Queue&#60;Data&#62; &amp;obj)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;maxsize = obj.maxsize;</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin = obj.begin;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end = obj.end;</div><div class="code_line">&nbsp;&nbsp; &nbsp;elemCT = obj.elemCT;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;memcpy(this-&#62;queue, obj.queue, sizeof(Data)*maxsize);</div><div class="code_line">&nbsp;&nbsp; &nbsp;return *this;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetBuffer(Queue&#60;Data&#62; obj)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;memcpy(obj, this-&#62;queue, sizeof(Data)*maxsize)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return 0;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetBegin()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;return this-&#62;begin;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetEnd()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;return this-&#62;end;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetCountElements()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;return this-&#62;maxsize;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; int Queue&#60;Data&#62;::GetCurrentCount()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;return this-&#62;elemCT;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; bool Queue&#60;Data&#62;::IsEmpty()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (this-&#62;elemCT)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return true;</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return false;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Queue&#60;Data&#62;&amp; Queue&#60;Data&#62;::operator + (const Data &amp;obj)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (elemCT &#60; maxsize)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;queue[elemCT] = obj;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;elemCT++;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;end++;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;memcpy(queue[0], queue[1], sizeof(Data)*(elemCT - 1));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;elemCT = maxsize;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;queue[maxsize - 1] = obj;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;return *this;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">template &#60;class Data&#62; Data Queue&#60;Data&#62;::operator - &nbsp;()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;Data temp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;temp = queue[0];</div><div class="code_line">&nbsp;&nbsp; &nbsp;memcpy(queue[0], queue[1], sizeof(Data)*(elemCT - 1));</div><div class="code_line">&nbsp;&nbsp; &nbsp;elemCT--;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end--;</div><div class="code_line">&nbsp;&nbsp; &nbsp;return temp;</div><div class="code_line">}</div></ol></div></div></div></div>]]></description>
        <author>VictorSh</author>
        <category>C/C++: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	