Note that there are some explanatory texts on larger screens.

plurals
  1. POError compiling std::count() in solaris
    primarykey
    data
    text
    <p>I am using std::count() in my code. My code is successfully build in windows but I am unable to compile this under Solaris,</p> <p>Complete function is given below,</p> <pre><code>unsigned int BBGENTVerify::tokenizeTickerEID(const std::string p_czTickerEIDs,\ std::vector&lt;int&gt;&amp; p_rTickerEIDsVector){ int l_iStartPos = -1; int l_iEndPos = -1; unsigned int l_iEIDsPresent = std::count(p_czTickerEIDs.c_str(), \ p_czTickerEIDs.c_str() + p_czTickerEIDs.size(), ',') + 1; do{ l_iEndPos = p_czTickerEIDs.find(",", l_iStartPos + 1); if (l_iEndPos == -1){ l_iEndPos = p_czTickerEIDs.size() - l_iStartPos; } p_rTickerEIDsVector.push_back(atoi\ (p_czTickerEIDs.substr(l_iStartPos +1, l_iEndPos).c_str())); l_iStartPos = l_iEndPos; }while(p_rTickerEIDsVector.size() &lt; l_iEIDsPresent); return p_rTickerEIDsVector.size(); } </code></pre> <p>I am getting error,</p> <pre><code>"src/fileENTForP.cpp", line 136: Error: Could not find a match for std::count&lt;std::InputIterator, std::T, std::Size&gt;(const char*, const char*, char) needed in BBGENTVerify::tokenizeTickerEID(const std::string, std::vector&lt;int&gt;&amp;). 1 Error(s) detected. clearmake: Error: Build script failed for "release/sun_solaris64/BBGENTVerify.o"\ </code></pre> <p><strong>This code is successfully compiled in windows platform.</strong> I did some investigation and found that Solaris complier is somehow taking some other template signature, with one extra parameter.</p> <pre><code>Error: Could not find a match for std::count&lt;std::InputIterator, std::T, std::Size&gt; (const char*, const char*, char) </code></pre> <p>whereas standard says the signature,</p> <pre><code>template &lt;class InputIterator, class T&gt; typename iterator_traits&lt;InputIterator&gt;::difference_type count (InputIterator first, InputIterator last, const T&amp; val); </code></pre> <p>Code is expecting this signature</p> <pre><code>std::count&lt;std::InputIterator, std::T, std::Size&gt; </code></pre> <p>where as I am using/also what standard C++ supports, </p> <pre><code>template &lt;class InputIterator, class T&gt; std::count(InputIterator first, InputIterator last, const T&amp; val); </code></pre> <p>Please help me with this code.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload