I try using IterableMapping
by this example.
I have error when I compiling contract by truffle:
Expected identifier, got 'LParen'
This is my code:
pragma solidity ^0.4.15;
import "./itMapsLib.sol";
contract User
{
using itMaps for itMaps.itMapUintAddress;
itMaps.itMapAddressUint im_myAddressUintMap;
function addOwner(address _key, uint value) returns (bool){
im_myAddressUintMap.insert(_key, value);
return true;
}
function allSum() returns (uint sum)
{
}
}
Best Answer
There is several problems with your code.
You copy paste the function prototype instead of calling it you should use
im_myAddressUintMap.insert( key, value);
And you have to make this insert inside a function or inside the constructor ( function with the name of the contract )
so the contract should be something like this
second import is to test on remix
Edit : you edited your contract. The last error you have is the incorrect import of
using itMaps for itMaps.itMapUintAddress;
you're usingitMapAddressUint