#Argument for class template ... missing

23 messages · Page 1 of 1 (latest)

wanton flare
#

Intellisense says "Argument for class template CollisionBody is missing"

class CollisionBody : public Actor{
public:
    std::unique_ptr<ShapeBase> shape;

    olc::vf2d velocity = {0.0f, 0.0f};
    olc::vf2d acceleration = {5000.0f, 5000.0f};
    olc::vf2d collision_normal = {0.0f, 0.0f};
    
    template<typename tShape, typename ...tArgs>
    void SetShape(tArgs ..._args){
        auto l_shape = std::make_unique<Shape<tShape>>(tShape(_args...));
        l_shape->callbacks.push_back(
            std::function<void(Shape<tShape>* _shape)>([](Shape<tShape>* _shape) -> void {
                System::Get().Func(_shape);
            })
        );

And I can't just compile this and see if it says something because this is a piece of something that takes more time to rework. Plus, interestingly it's not raising any issues in my test file, which compiles successfully. I think it's complaining about the lack of a template<class ...> above the class declaration, but I'm not TRYING to make a template class. So what is happening here?

obtuse socketBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

wanton flare
#

Aaaand there is more.

CollisionBody(olc::vf2d _position) : Actor(_position){
        //if(Engine::Get().vsync) acceleration = {0.1f, 0.1f};
    }

Here's the constructor for example. Not spotting any issues with it.

#

Maybe I should just ignore this and keep cooking. Maybe it's just intellisense messing with me.

modern ruin
#

D) Can you send the full error?

wanton flare
# modern ruin D) Can you send the full error?

I sent the full error. I only have an intellisense error, I literally can't compile the full thing, I stated that very clearly.
I do have a test file though, maybe I can share that, because it does not give me the same error there.

#

I forgot how to use pastebin.

modern ruin
wanton flare
#

I go to pastebin, paste the thing and think, wait, what do I do now?

wanton flare
modern ruin
wanton flare
modern ruin
wanton flare
modern ruin
#

*And also what about B? Did you try to simply restart your IDE? Sometimes that fixes it

wanton flare
modern ruin
wanton flare
sleek trench
#

Are you including any other libraries which might also be defining CollisionBody? If you just write CollisionBody on it's own before where you defined it can you right click and "jump to declaration"?
Also if you're using Visual Studio it's worth closing, going into windows explorer and under view selecting "show hidden files", then in the project folder delete the .vs folder, then reopen the project.

wanton flare