-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request EOSIO#133 from EOSIO/feature/ignored_and_contract_…
…attr Feature/ignored and contract attr
- Loading branch information
Showing
6 changed files
with
117 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
namespace eosio { | ||
/** | ||
* Tells the datastream to ignore this type, but allows the abi generator to add the correct type. | ||
* Currently non-ignore types can not succeed an ignore type in a method definition, i.e. void foo(float, ignore<int>) is allowed and void foo(float, ignore<int>, int) is not allowed. | ||
* This restriction will be relaxed in a later release. | ||
* @brief Tells the datastream to ignore this type, but allows the abi generator to add the correct type. | ||
* Currently non-ignore types can not succeed an ignore type in a method definition, i.e. void foo(float, ignore<int>) is allowed and void foo(float, ignore<int>, int) is not allowed. | ||
* This restriction will be relaxed in a later release. | ||
*/ | ||
template <typename T> | ||
struct [[eosio::ignore]] ignore {}; | ||
|
||
/** | ||
* Wrapper class to allow sending inline actions with the correct payload | ||
* @brief Wrapper class to allow sending inline actions with the correct payload | ||
*/ | ||
template <typename T> | ||
struct ignore_wrapper { | ||
constexpr ignore_wrapper() {} | ||
constexpr ignore_wrapper(T val) : value(val) {} | ||
constexpr ignore_wrapper(ignore<T> val) {} | ||
constexpr inline T get() { return value; } | ||
constexpr operator T() { return value; } | ||
constexpr operator ignore<T>() { return {}; } | ||
T value; | ||
}; | ||
} //ns eosio |