Forwarded from Maxim
Почему-то этот кусок кода выдает ошибку
In template: no matching function for call to 'construct_at' error occurred here in instantiation of function template specialization 'std::_Construct<BrickWall, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, const float &>' requested here in instantiation of function template specialization 'std::allocator_traits<std::allocator<void>>::construct<BrickWall, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, c... in instantiation of function template specialization 'std::_Sp_counted_ptr_inplace<BrickWall, std::allocator<void>, __gnu_cxx::_S_atomic>::_Sp_counted_ptr_inplace<BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const... in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<BrickWall, std::allocator<void>, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float... in instantiation of function template specialization 'std::__shared_ptr<BrickWall, __gnu_cxx::_S_atomic>::__shared_ptr<std::allocator<void>, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, gl... in instantiation of function template specialization 'std::shared_ptr<BrickWall>::shared_ptr<std::allocator<void>, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, const ... in instantiation of function template specialization 'std::make_shared<BrickWall, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, const float &>' requested here candidate template ignored: substitution failure [with _Tp = BrickWall, _Args = <BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, const float &>]: allocating an object of...
In template: no matching function for call to 'construct_at' error occurred here in instantiation of function template specialization 'std::_Construct<BrickWall, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, const float &>' requested here in instantiation of function template specialization 'std::allocator_traits<std::allocator<void>>::construct<BrickWall, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, c... in instantiation of function template specialization 'std::_Sp_counted_ptr_inplace<BrickWall, std::allocator<void>, __gnu_cxx::_S_atomic>::_Sp_counted_ptr_inplace<BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const... in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<BrickWall, std::allocator<void>, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float... in instantiation of function template specialization 'std::__shared_ptr<BrickWall, __gnu_cxx::_S_atomic>::__shared_ptr<std::allocator<void>, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, gl... in instantiation of function template specialization 'std::shared_ptr<BrickWall>::shared_ptr<std::allocator<void>, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, const ... in instantiation of function template specialization 'std::make_shared<BrickWall, BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, const float &>' requested here candidate template ignored: substitution failure [with _Tp = BrickWall, _Args = <BrickWall::WallType, const glm::vec<2, float, glm::packed_highp> &, const glm::vec<2, float, glm::packed_highp> &, const float &>]: allocating an object of...
return std::make_shared<BrickWall>(BrickWall::WallType::Right, position, scale, rotation);
BrickWall(const WallType wallType, const glm::vec2 &position, const glm::vec2 &scale, const float rotation);
Какой вариант корректно удалит все элементы из STL map
// a
for(auto i = map.begin(); i != map.end(); ++i) {
map.erase(i);
}
// b
for(auto i = map.begin(); i != map.end(); i++) {
map.erase(i);
}
// c
for(auto i = map.begin(); i != map.end(); ) {
map.erase(++i);
}
// d
for(auto i = map.begin(); i != map.end(); ) {
map.erase(i++);
}
Какой вариант корректно удалит все элементы из STL map
Anonymous Poll
16%
for(auto i = map.begin(); i != map.end(); ++i) map.erase(i);
16%
for(auto i = map.begin(); i != map.end(); i++) map.erase(i);
6%
for(auto i = map.begin(); i != map.end(); ) map.erase(++i);
63%
for(auto i = map.begin(); i != map.end(); ) map.erase(i++);
greg
Photo
Спасибо студентам курса Алгоритмы и Структуры данных Весна 2024 ПИиКТ ИТМО за контент в паблик.
Forwarded from Stepan
std::iota::poebota::rangers::ranges
🔥9
Forwarded from Кавайная Няшка
помогите пофиксить
malloc(std::chrno::milliseconds(200).detach());
😁4❤2
Forwarded from Vitya Smirnov
YouTube
Coding In China Be Like (C++)
Font used:
Consolas
Credits:
https://www.youtube.com/watch?v=0cjQ-QFimw4
if (you.liked((*this).video)) {
subscribe.to(SENTRY);
} else if (you.disliked((*this).video)) {
subscribe.to(SENTRY);
} else {
subscribe.to(SENTRY);
}
#meme
#memes…
Consolas
Credits:
https://www.youtube.com/watch?v=0cjQ-QFimw4
if (you.liked((*this).video)) {
subscribe.to(SENTRY);
} else if (you.disliked((*this).video)) {
subscribe.to(SENTRY);
} else {
subscribe.to(SENTRY);
}
#meme
#memes…
👍3
int plus(int a, int b);
int minus(int a, int b);
int plus(int a, int b){
if(a<0 && b>0) return minus(b, -a);
if(b<0 && a>0) return minus(a, -b);
if(a<0 && b<0) return -plus(-a, -b);
if(a==0) return b;
if(b==0) return a;
return plus(a-1, b-1)+2;
}
int minus(int a, int b){
if(a<0 && b>0) return -plus(-a, b);
if(b<0 && a>0) return plus(a, -b);
if(a<0 && b<0) return -minus(-a, -b);
if(a==0) return -b;
if(b==0) return a;
return minus(a-1, b-1);
}
🔥1
#![no_main]
#[link_section=".text"]
#[no_mangle]
pub static main: [u32; 9] = [
3237986353,
3355442993,
120950088,
822083584,
252621522,
1699267333,
745499756,
1919899424,
169960556,
];
👍6
В std::function нельзя сложить лямбду которая захватила uptr
