Skip to content

请问"vector 不是模板"如何解决 #623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kyuseilee opened this issue Aug 31, 2020 · 3 comments
Closed

请问"vector 不是模板"如何解决 #623

Kyuseilee opened this issue Aug 31, 2020 · 3 comments
Labels

Comments

@Kyuseilee
Copy link

image
网上搜到的加头文件解决效率好低

@jdneo
Copy link
Member

jdneo commented Aug 31, 2020

This extension does not provide any language support related features.

I guess you get such error because you installed the related extensions. (for example, c++ extension)

Unfortunately, there is nothing we can do about this so far. Since this is out of the scope of the LeetCode extension.

@jdneo jdneo closed this as completed Aug 31, 2020
@jdneo jdneo added the question label Aug 31, 2020
@Nikita240
Copy link

Nikita240 commented Dec 11, 2020

@jdneo I disagree.

You could provide an include to a header file that contains all the symbols that LeetCode uses.

The leetcode-cli cpp.run plugin already has all the information to do this since it puts all of the symbols definitions in the run file when you run a local test.

If you want to see for yourself, start a sample problem and run leetcode test 001.two-sum.cpp --local. Then take a look at the generated .tmp.cpp.run.cpp file.

The file contains all of the LeetCode specific symbols, a main method, and your Solution class copy-pasted.

My workaround for a while has been to just work directly in the generated .tmp.cpp.run.cpp file, then when I'm done I copy-paste the Solution to the actual .cpp file for the problem before submitting. A nicer approach would be awesome.

@Nikita240
Copy link

Also, please note that without doing the trick I discussed above, there is no way to debug your program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants