While trying to understand the OpenZeppelin contracts that a contract inherited from, I stumbled upon the line using Counters for Counters.Counter;
after the counters library of OpenZeppelin was imported: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Counters.sol
I realized that this way of using the library is "advised" in the source code on OpenZeppelin GitHub. However, I don't understand why. Quick researches taught me that the using
keyword was used to allow specific types to use functions from a library as if they were properties from those types (https://medium.com/coinmonks/soliditys-using-keyword-c05c18aaa088).
I would have thought importing the library would have been enough. If anyone could explain to me the coding logic behind that, it would help me a lot. Thanks.