Skip to content

Commit

Permalink
ARROW-1452: [C++] Restore DISALLOW_COPY_AND_ASSIGN usages removed in …
Browse files Browse the repository at this point in the history
…ARROW-1452 patch

Also updated the definition of DISALLOW_COPY_AND_ASSIGN to use the one from Apache Kudu, which has seen significantly more scrutiny than ours (https://github.com/apache/kudu/blob/master/src/kudu/gutil/macros.h#L96).

Author: Wes McKinney <[email protected]>

Closes apache#1036 from wesm/ARROW-1452-followup and squashes the following commits:

bfab15b [Wes McKinney] clang-format
75a95b9 [Wes McKinney] Restore DISALLOW_COPY_AND_ASSIGN usages removed in ARROW-1452 patch
  • Loading branch information
wesm committed Sep 4, 2017
1 parent cc30512 commit f391950
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cpp/src/arrow/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ class ARROW_EXPORT Array {
}
data_ = data;
}

private:
ARROW_DISALLOW_COPY_AND_ASSIGN(Array);
};

static inline std::ostream& operator<<(std::ostream& os, const Array& x) {
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/arrow/io/interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class ARROW_EXPORT FileInterface {
FileInterface() {}
FileMode::type mode_;
void set_mode(FileMode::type mode) { mode_ = mode; }

private:
ARROW_DISALLOW_COPY_AND_ASSIGN(FileInterface);
};

class ARROW_EXPORT Seekable {
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/arrow/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ class ARROW_EXPORT DataType {
protected:
Type::type id_;
std::vector<std::shared_ptr<Field>> children_;

private:
ARROW_DISALLOW_COPY_AND_ASSIGN(DataType);
};

// TODO(wesm): Remove this from parquet-cpp
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/util/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef ARROW_DISALLOW_COPY_AND_ASSIGN
#define ARROW_DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \
TypeName& operator=(const TypeName&) = delete
void operator=(const TypeName&) = delete
#endif

#define ARROW_UNUSED(x) (void)x
Expand Down

0 comments on commit f391950

Please sign in to comment.