pragma solidity ^0.4.8;
library Library {
struct data {
unit val;
}
}
-
contract Array{
using Library for Library.data;
mapping(address => Library.data) clusterContract;
function addCluster(address id) returns(bool){
if(clusterContract[id] == address(0) ){ //error occurs!
clusterContract[id] = list;
return true;
}
return false;
}
}
判断语句if(clusterContract[id] == address(0))
给出了错误。错误如下所示:
Operator == not compatible with types struct Library.data storage ref and address
E if(clusterContract[id] == address(0) ){...
请问:我该怎么解决这个错误呢?
谢谢你宝贵的时间和帮助。