Skip to content

Assignment of std::vector<std::string> gives unexpected results #4

@maarten-ic

Description

@maarten-ic

Assigning a vector of strings to an HDC node compiles successfully (unless -DDEBUG is defined), but the result is unexpected:

#include <hdc.hpp>

int main() {
    HDC test;
    test["vector_of_strings"] = std::vector<std::string>({"string 1", "string 2"});
    test.dump();
    return 0;
}

Results in output

{
        "vector_of_strings" : "\u043d\u022cgU"
}

Expected behaviour:

  • If this is supported, I would expect to either see an array of strings (or potentially a 2D character array) in vector_of_strings
  • If this is an unsupported use-case, a compile-time error should prevent assignment of a std::vector<std::string>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions