Menu

warning: noConstructor Class "" does not have a constructor

Andy.Yin
2015-04-01
2015-04-06
  • Andy.Yin

    Andy.Yin - 2015-04-01

    Hi all:
    Recently, I got this warning "cppcheck: warning: noConstructor:extension/ca/cti/service/TSmartCardAdaptee.h:15: The class 'TSmartCardAdaptee' does not have a constructor." and the cppcheck is 1.68

    and the sample code is :
    #include "base/Singleton.h"

    include <iostream>

    include <fstream>

    class TNvRamAdaptee
    {
    DEF_SINGLETON(TNvRamAdaptee);

    private:
    std::fstream DbFile;

    public:
    void Init(std::string file, int DbFileSize);
    uint16_t Write(uint8_t data, uint16_t len, uint16_t position);
    uint16_t Read(uint8_t
    data, uint16_t len, uint16_t position);

    };

    and the Singleton.h is :

    define DEF_SINGLETON(T) \

    public: \ static T& GetInstance() \ { \ static T Instance; \ return Instance; \ } \ private: \ T() { /* empty. /} \ NON_COPYABLE(T)

    endif

     

    Last edit: Andy.Yin 2015-04-01
  • Daniel Marjamäki

    please report bugs here: http://trac.cppcheck.net

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.