title: C++: What error in using STL vector
body: <p>I was using the topcoder C++ compiler, and although this code just run fine in Linux gcc, the topcoder compiler gave this error:</p>
  
  <pre><code>your code did not compile:
  
  errors compiling:
  
  Your class or method was improperly declared: In function
     ‘std::vector&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, 
     std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; _wrapper::thunk(std::string)’:
  
  Your class or method was improperly declared:20034: 
  error: conversion from ‘void’ to non-scalar type
  ‘std::vector&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, 
  std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;’ requested
  </code></pre>
  
  <p>This is the code snippet where it is flagging error:</p>
  
  <pre><code>class BinaryCode {
  
      public:
              static int get_digit(char c)
              {
                      return (c-'0');
              }
              void decode(string decd)
              {
                      int i;
  
                      std::vector &lt;int&gt; decoded(decd.size());
                      std::transform(decd.begin(), decd.end(), decoded.begin(), &amp;get_digit);
  
                      int length=decoded.size();
  </code></pre>
  
  <p>This is the topcoder problem description:</p>
  
  <pre><code>Definition Class:BinaryCode
  Method:decode
  
  Parameters:string
  Returns:vector &lt;string&gt;
  
  Method signature:
  vector &lt;string&gt; decode(string message)
  </code></pre>
  
  <p>(be sure your method is public)
      </p>