The only problem is std::ohserialstream cout(Serial), the compiler gives errors that sounds like an operator should be overloaded. I'm not familiar enough with c++ to understand what to do when I see this kind of error.
info: I got the -std=c++11 flag activated. My goal is for ohserialstream to work correctly.
Code used: GitHub - maniacbug/StandardCplusplus: Standard C++ for Arduino (port of uClibc++)
This is taken from the example, I've commented out the irrelevant rows.
#include <StandardCplusplus.h>
#include <serstream>
#include <string>
#include <vector>
#include <iterator>
using namespace std;
namespace std
{
ohserialstream cout(Serial);
}
vector<string> strings;
void setup(void)
{
Serial.begin(57600);
strings.push_back("Hello,");
strings.push_back("world!");
//copy(strings.begin(),strings.end(),ostream_iterator<string>(cout," "));
//cout << endl;
}
void loop(void)
{
}
The error:
Arduino: 1.6.0 (Windows 7), Board: "Arduino Leonardo"
string_vector.ino:13:29: error: no matching function for call to 'std::basic_oserialstream<char>::basic_oserialstream(Serial_&)'
string_vector.ino:13:29: note: candidates are:
In file included from string_vector.ino:2:0:
C:\Users\<name>\Documents\Arduino\libraries\maniac/serstream:230:12: note: std::basic_oserialstream<charT, traits, Tserial>::basic_oserialstream(Tserial&) [with charT = char; traits = std::char_traits<char>; Tserial = HardwareSerial]
: basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb), sb(serial_,ios_base::out)
^
C:\Users\<name>\Documents\Arduino\libraries\maniac/serstream:230:12: note: no known conversion for argument 1 from 'Serial_' to 'HardwareSerial&'
C:\Users\<name>\Documents\Arduino\libraries\maniac/serstream:213:60: note: std::basic_oserialstream<char>::basic_oserialstream(const std::basic_oserialstream<char>&)
: public basic_ostream<charT,traits>
^
C:\Users\<name>\Documents\Arduino\libraries\maniac/serstream:213:60: note: no known conversion for argument 1 from 'Serial_' to 'const std::basic_oserialstream<char>&'
Error compiling.
I've tried my best solving it on my own... sadly that's not good enough.