title: How can Boost Program_Options handle vector of arrays?
body: <p>In my program, I need to perform some transformations uing the Eigen library. As I am using a config file for the user to ajust some settings, I am searching for a way to integrate the transformations in this config file. I came up with the following code:</p>
  
  <pre><code>#include &lt;boost\program_options.hpp&gt;
  #include &lt;boost\log\trivial.hpp&gt;
  #include &lt;Eigen\Geometry&gt;
  
  namespace po = boost::program_options;
  
  int main(int ac, char* av[])
  {
      std::vector&lt;std::array&lt;double, 16&gt;&gt; trans;
  
      try {
          po::options_description desc("Options");
          desc.add_options()
              ("help,h", "Produce help message")
              ("config,c", po::value&lt;std::string&gt;(&amp;configPath), "Path of the config file.")
              ("trans", po::value&lt;std::vector&lt;std::array&lt;double, 16&gt;&gt;&gt;(&amp;trans)-&gt;multitoken(), "Vector of 4D Transformation Matrix. Syntax: {x_11, ..., x_14, x_21, ..., x_24, ..., x_44}")
              ;
  
          po::variables_map vm;
          po::store(po::parse_command_line(ac, av, desc), vm);
          po::notify(vm);
  
          if (vm.count("help")) {
              BOOST_LOG_TRIVIAL(info) &lt;&lt; desc;
              return EXIT_SUCCESS;
          }
  
          std::ifstream configFile(configPath);
          po::store(po::parse_config_file(configFile, desc), vm);
          po::notify(vm);
      }
      catch (std::exception&amp; e) {
          BOOST_LOG_TRIVIAL(error) &lt;&lt; "error: " &lt;&lt; e.what();
          return EXIT_FAILURE;
      }
      catch (...) {
          BOOST_LOG_TRIVIAL(error) &lt;&lt; "Exception of unknown type!";
          return EXIT_FAILURE;
      }
  
      Eigen::Affine3d transAff(Eigen::Matrix4d(trans.data()).transpose());
  
      // Do some stuff
  }
  </code></pre>
  
  <p>But unfortunately I am running in an error when building my solution. The error happens at the add_options line of the transform and says:</p>
  
  <pre><code>myDirectory\vcpkg\installed\x64-windows\include\boost\lexical_cast\detail\converter_lexical.hpp(243): error C2338: Target type is neither std::istream`able nor std::wistream`able
  myDirectory\vcpkg\installed\x64-windows\include\boost\lexical_cast\detail\converter_lexical.hpp(270): note: see reference to class template instantiation 'boost::detail::deduce_target_char_impl&lt;boost::detail::deduce_character_type_later&lt;std::array&lt;double,16&gt;&gt;&gt;' being compiled
  myDirectory\vcpkg\installed\x64-windows\include\boost\lexical_cast\detail\converter_lexical.hpp(407): note: see reference to class template instantiation 'boost::detail::deduce_target_char&lt;Target&gt;' being compiled
          with
          [
              Target=std::array&lt;double,16&gt;
          ]
  myDirectory\vcpkg\installed\x64-windows\include\boost\lexical_cast\detail\converter_lexical.hpp(464): note: see reference to class template instantiation 'boost::detail::lexical_cast_stream_traits&lt;Source,Target&gt;' being compiled
          with
          [
              Source=src,
              Target=std::array&lt;double,16&gt;
          ]
  myDirectory\vcpkg\installed\x64-windows\include\boost\lexical_cast\try_lexical_convert.hpp(196): note: see reference to class template instantiation 'boost::detail::lexical_converter_impl&lt;Target,src&gt;' being compiled
          with
          [
              Target=std::array&lt;double,16&gt;
          ]
  myDirectory\vcpkg\installed\x64-windows\include\boost\lexical_cast.hpp(41): note: see reference to function template instantiation 'bool boost::conversion::detail::try_lexical_convert&lt;Target,Source&gt;(const Source &amp;,Target &amp;)' being compiled
          with
          [
              Target=std::array&lt;double,16&gt;,
              Source=std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;
          ]
  myDirectory\vcpkg\installed\x64-windows\include\boost\program_options\detail\value_semantic.hpp(92): note: see reference to function template instantiation 'Target boost::lexical_cast&lt;T,std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;&gt;(const Source &amp;)' being compiled
          with
          [
              Target=std::array&lt;double,16&gt;,
              T=std::array&lt;double,16&gt;,
              Source=std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;
          ]
  myDirectory\vcpkg\installed\x64-windows\include\boost\program_options\detail\value_semantic.hpp(149): note: see reference to function template instantiation 'void boost::program_options::validate&lt;T,char&gt;(boost::any &amp;,const std::vector&lt;std::string,std::allocator&lt;_Ty&gt;&gt; &amp;,T *,long)' being compiled
          with
          [
              T=std::array&lt;double,16&gt;,
              _Ty=std::string
          ]
  myDirectory\vcpkg\installed\x64-windows\include\boost\program_options\detail\value_semantic.hpp(184): note: see reference to function template instantiation 'void boost::program_options::validate&lt;std::array&lt;double,16&gt;,char&gt;(boost::any &amp;,const std::vector&lt;std::string,std::allocator&lt;_Ty&gt;&gt; &amp;,std::vector&lt;std::array&lt;double,16&gt;,std::allocator&lt;std::array&lt;double,16&gt;&gt;&gt; *,int)' being compiled
          with
          [
              _Ty=std::string
          ]
  myDirectory\vcpkg\installed\x64-windows\include\boost\program_options\detail\value_semantic.hpp(177): note: while compiling class template member function 'void boost::program_options::typed_value&lt;std::vector&lt;std::array&lt;double,16&gt;,std::allocator&lt;_Ty&gt;&gt;,char&gt;::xparse(boost::any &amp;,const std::vector&lt;std::string,std::allocator&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;&gt;&gt; &amp;) const'
          with
          [
              _Ty=std::array&lt;double,16&gt;
          ]
  myDirectory\myProgram\src\myProgram.cpp(91): note: see reference to class template instantiation 'boost::program_options::typed_value&lt;std::vector&lt;std::array&lt;double,16&gt;,std::allocator&lt;_Ty&gt;&gt;,char&gt;' being compiled
          with
          [
              _Ty=std::array&lt;double,16&gt;
          ]
  </code></pre>
  
  <p>I think the error is due to the fact that vectors of arrays are not supported the way I try to do it. Is there any way to accomplish that or even a smarter way of handling those transformations?</p>
  
  <p>Thanks a lot!</p>