Closed 84356813 closed 8 years ago
it works,but not so well.
`#include
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;
Thanks for noticing. Fixed in https://github.com/matt-42/silicon/commit/e54e174e5eea17ecfd5805ff7b45e3711a8f0030
`#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;
}`
out put :
Is there some way to make "type_string(std::vector*)" to output "vector of {name: string, age: int, city: string}"