GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: remove NonCopyableMaybe · nodejs/node@c815f29

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • util.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/util.h‎

Copy file name to clipboardExpand all lines: src/util.h
-32Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -656,38 +656,6 @@ struct MallocedBuffer {
656656
MallocedBuffer& operator=(const MallocedBuffer&) = delete;
657657
};
658658

659-
template <typename T>
660-
class NonCopyableMaybe {
661-
public:
662-
NonCopyableMaybe() : empty_(true) {}
663-
explicit NonCopyableMaybe(T&& value)
664-
: empty_(false),
665-
value_(std::move(value)) {}
666-
667-
bool IsEmpty() const {
668-
return empty_;
669-
}
670-
671-
const T* get() const {
672-
return empty_ ? nullptr : &value_;
673-
}
674-
675-
const T* operator->() const {
676-
CHECK(!empty_);
677-
return &value_;
678-
}
679-
680-
T&& Release() {
681-
CHECK_EQ(empty_, false);
682-
empty_ = true;
683-
return std::move(value_);
684-
}
685-
686-
private:
687-
bool empty_;
688-
T value_;
689-
};
690-
691659
// Test whether some value can be called with ().
692660
template <typename T, typename = void>
693661
struct is_callable : std::is_function<T> { };

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.