Trying to make SwerveModule Class

I’m trying to make a SwerveModule class using the TalonFXs. Gives me build time error. Help. WPILib version 2023.


#pragma once

#include <ctre/Phoenix.h>

class SwerveModule {
    public:
        SwerveModule(int drive_motor_id, int steering_motor_id, int cancoder_id) {
            drive_motor{drive_motor_id};
            steering_motor{steering_motor_id};
            cancoder{cancoder_id};
        };

    private:
        TalonFX drive_motor;
        TalonFX steering_motor;
        CANCoder cancoder;
};

You have several syntax errors for how the constructor should be formed. It should be ClassName(...) : member{...}, member{...} { ... }. See below.

Thanks!