Coder Social home page Coder Social logo

"type_string" output of vector about silicon HOT 3 CLOSED

matt-42 avatar matt-42 commented on September 14, 2024
"type_string" output of vector

from silicon.

Comments (3)

matt-42 avatar matt-42 commented on September 14, 2024

It should work now: 9741159#diff-60cb1e143f8c8fa9e4aca20cab1f6a50R36

from silicon.

84356813 avatar 84356813 commented on September 14, 2024

it works,but not so well.
`#include

#include <silicon/api.hh>
#include <silicon/api_description.hh>

#include "symbols.hh"

using namespace sl; // Silicon namespace
using namespace s; // Symbols namespace

int main()
{
typedef decltype(D(_name = std::string(), _age = int(), _city = std::string())) User;

User u("John", 23, "NYC");
std::vector<User> ul;
ul.push_back(u);
auto x = D(_num=1,_date=ul);
std::cout << "-----type_string(User)-----" <<std::endl;
std::cout << type_string( &u ) <<std::endl;
std::cout << "-----type_string(std::vector<user>)-----" <<std::endl;
std::cout << type_string( &ul ) <<std::endl;
std::cout << "-----type_string(D(_num=int(1),_date=std::vector<user>()))-----" <<std::endl;
std::cout << type_string(&x) <<std::endl;
return 0;

}
`
out put:

`-----type_string(User)-----

{name: string, age: int, city: string}

-----type_string(std::vector)-----

vector of {name: string, age: int, city: string}

-----type_string(D(_num=int(1),_date=std::vector()))-----

{num: int, date: vector of void}

`
when a vector nesting in a sio, it does not work again;

from silicon.

matt-42 avatar matt-42 commented on September 14, 2024

Thanks for noticing. Fixed in e54e174

from silicon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.