msgpack/msgpack-c — pull request #100 by redboltz (2014-08-04 06:37:41+00:00)
Title: vector<char> is mapped to BIN

Added the new mapping:
std::vector is mapped to BIN.

So, currently BIN, STR, and ARRAY mappings are as follows:
std::vector is mapped to BIN
std::string is mapped to STR
std::vector is mapped to ARRAY // T is not char

This is a PR for poc/0.6. It is a breaking change so I'd like to have a discussion. The new msgpack format supports BIN and STR. BIN is binary. STR is UTF-8 string. https://github.com/msgpack/msgpack/blob/master/spec.md

C++ doesn't have UTF-8 string type. When users pack std::string, there are two design choice. Those are BIN or STR. I've chosen STR. This is not a part of this PR. That have already committed.

How about BIN? I believe that std::vector is suitable type to map to BIN. So I created the PR. Someone might consider that std::vector is good. However, I don't think so. C++ uses char as binary byte data like as ostream::write:
http://www.cplusplus.com/reference/ostream/ostream/write/?kw=write

There is another design choice. That is, no direct type mapping to BIN. Users always call the following functions when they want to map tp BIN:

```C++
o.pack_bin(v.size());
o.pack_bin_body(v.data(), v.size());
```

I think that it is convenient providing some direct mapped type to BIN, and that is std::vector.

Any ideas?

If there is no strong against opinion, I will merge the PR.