Coder Social home page Coder Social logo

Comments (3)

billyquith avatar billyquith commented on June 11, 2024

What is stopping you from doing that?

from ponder.

thegoodtgg avatar thegoodtgg commented on June 11, 2024

I also failed to build ponder-v3.0.0 on visual studio 2019. Then I tried to build it on visual studio 2015 and it also failed. The error happened while building the "args.cpp".
I think it failed on forward declaration for "ponder::Value". Then I digged into source then find that "ponder::Value" dependent on "ponder::UserObject", "ponder::UserObject" dependent on "ponder::Args" and "ponder::Value", "ponder::Args" dependent on "Ponder::Value". So @billyquith used forward declaration in the "args.hpp" for "ponder::Value".
However, I don't understand how std::vector instantiate while missing "ponder::Value" definition.

1>args.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(1279): error C2036: 'const ponder::Value *': unknown size
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(1276): note: while compiling class template member function 'void std::vector<ponder::Value,std::allocator<_Ty>>::push_back(const ponder::Value &)'
1> with
1> [
1> _Ty=ponder::Value
1> ]
1>D:\third-party\C++\common\reflection\ponder-3.0.0\src\args.cpp(63): note: see reference to function template instantiation 'void std::vector<ponder::Value,std::allocator<_Ty>>::push_back(const ponder::Value &)' being compiled
1> with
1> [
1> _Ty=ponder::Value
1> ]
1>D:\third-party\C++\common\reflection\ponder-3.0.0\include\ponder/args.hpp(143): note: see reference to class template instantiation 'std::vector<ponder::Value,std::allocator<_Ty>>' being compiled
1> with
1> [
1> _Ty=ponder::Value
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(1285): error C2036: 'ponder::Value *': unknown size
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(1294): error C2036: 'ponder::Value *': unknown size
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(1296): error C2036: 'ponder::Value *': unknown size

from ponder.

thegoodtgg avatar thegoodtgg commented on June 11, 2024

I try the code below. It do failed.

`
// Foo.h
#pragma once
struct Foo {
int v_;
}

// FooList.h
#pragma once
#include

struct Foo;
struct FooList {
void push_back(Foo &f);

std::vector<Foo> vec_foo_;

};

// FooList.cpp
#include "FooList.hpp"
#include "Foo.hpp"

void FooList::push_back(Foo &f) {
vec_foo_.push_back(f);
}

// main.cpp
#include "FooList.hpp"

int main(int argc, char **argv) {
FooList list;
return 0;
}
`

from ponder.

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.