MCPcopy Create free account
hub / github.com/CLIUtils/CLI11 / AobjWrapper

Class AobjWrapper

tests/NewParseTest.cpp:501–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499/// simple class to wrap another with a very specific type constructor and assignment operators to test out some of the
500/// option assignments
501template <class X> class AobjWrapper {
502 public:
503 AobjWrapper() = default;
504 // delete all other constructors
505 template <class TT> AobjWrapper(TT &&obj) = delete;
506 // single assignment operator
507 AobjWrapper &operator=(X val) {
508 val_ = val;
509 return *this;
510 }
511 // delete all other assignment operators
512 template <typename TT> void operator=(TT &&obj) = delete;
513
514 CLI11_NODISCARD const X &value() const { return val_; }
515
516 private:
517 X val_{};
518};
519
520static_assert(std::is_assignable<AobjWrapper<std::uint16_t> &, std::uint16_t>::value,
521 "AobjWrapper not assignable like it should be ");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected