Macros | Functions
no_delete_t.cc File Reference
#include "boost/test/unit_test.hpp"
#include "cetlib/no_delete.h"
#include <iostream>
#include <memory>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (no_delete test)
 

Functions

 BOOST_AUTO_TEST_CASE (no_delete_t)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (no_delete test)

Definition at line 7 of file no_delete_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( no_delete_t  )

Definition at line 16 of file no_delete_t.cc.

17 {
18  std::ostringstream oss1, oss2;
19  auto* ossp1 = &oss1;
20  auto* ossp2 = &oss2;
21  {
22  std::shared_ptr<std::ostream>{&oss1, cet::no_delete()};
23  std::unique_ptr<std::ostream, cet::no_delete>{&oss2};
24  }
25  BOOST_TEST(ossp1 == &oss1);
26  BOOST_TEST(ossp2 == &oss2);
27 }