repl.it
@TaeHunKim/

testnullness

C++11

No description

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <memory>

class A{};
class B: public A {};

void func( std::shared_ptr<A>& a ) {
    std::cout << "hello" << std::endl;
}

int main() {
  auto bptr = std::make_shared<B>();
  func(bptr);
}
Fetching token
?