samedi 27 juin 2015

"invalid pure specifier" when I meant no pure specifier?

Consider the following snippet:

class UltraProbe {
public:
  ConnectProbe *CP() {
    return probes.CP;  // if type == UP_CONNECT
  }
private:
  probespec mypspec; /* Filled in by the appropriate set* function */
  union {
    IPExtraProbeData IP;
    ConnectProbe *CP;
    //    ArpProbe *AP;
  } probes;

};

bool do_one_select_round(UltraScanInfo *USI, struct timeval *stime) {

  UltraProbe *probe = NULL;
  int errno = (probe->CP()->connect_result);

}

Why am I getting the error below?

scan_engine_connect.cc:592:22: error: invalid pure specifier (only ‘= 0’ is allowed) before ‘probe’
         int errno = (probe->CP()->connect_result);
                      ^

Aucun commentaire:

Enregistrer un commentaire