Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken json_cast in current origin/master #88

Closed
repeatedly opened this issue Sep 25, 2012 · 0 comments
Closed

Broken json_cast in current origin/master #88

repeatedly opened this issue Sep 25, 2012 · 0 comments

Comments

@repeatedly
Copy link
Contributor

I have following code:

#include <pficommon/text/json.h>
#include <string>
#include <vector>

using namespace std;
using namespace pfi::text::json;

int main()
{
  json hoge(new json_object());
  vector<string> strs(json_cast<vector<string> >(hoge));

  return 0;
}

Current origin/master works.
But old version(e.g. pficommon 1.3.1) raises json_bad_cast.

$ ./a.out
terminate called after throwing an instance of 'pfi::text::json::json_bad_cast<std::vector<std::string, std::allocator<std::string> > >'
  what():  Failed json_cast from N3pfi4text4json11json_objectE to St6vectorISsSaISsEE.
zsh: abort      ./a.out

Older behavior seems to be correct.
"{}" should not be converted to vector, it's a map.

P.S.

d0d7361

This commit introduces new behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant