Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1、第一个函数缺少模版参数template,故加上;
2、逐元素相加首先找出a、b元素的共同类型,然后再找到a、b size小的那个值,然后再逐元素相加就行;
3、variant + variant用visit配合lambda就能实现;
4、variant + vector,因为这里不知道vector的具体类型,所以我重载了两个方法(感觉不够灵活);
5、最后打印variant、也是visit配合lambda使用;
我再研究下老师说得那个加分项怎么实现。