kaist-cp / cs220

268 stars 53 forks source link

[Assignment 10] (Addding Custom Datatypes to Pythagorean Implementation) #416

Closed dbekzhan closed 3 weeks ago

dbekzhan commented 3 weeks ago

Related Issue

no

Googling Result

no

ChatGPT Result

no

Your question here

Can we import more datatypes from std::collections?

When implementing Pythagorean struct, it says that we can add more fields. I assume it implies adding fields to the struct. However, I wanted to confirm if we can import datatypes from std::collections that might be helpful for struct fields?

For example:

use std::collections::*;

struct Pythagorean { // custom fields using some datatypes from std::collections }

As of now, there is only use std::collections::HashSet; available in the template code.

Jaewookim08 commented 3 weeks ago

Yes, you can import any type from the standard library.

dbekzhan commented 3 weeks ago

Thank you! And whan about importing anything from std in general. For example, std::cmp::*?

Jaewookim08 commented 3 weeks ago

I fixed the original comment to confirm you can use any types from the std. Just make sure that it passes the tests in gg.