Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e42668c

Browse files
committedJun 23, 2022
Shared/Sink/Source: remove operator overloaded API
No more assignment operator, type operator. This leads to less confusion as discussed in #67.
1 parent 3be602b commit e42668c

File tree

3 files changed

+0
-28
lines changed

3 files changed

+0
-28
lines changed
 

‎src/threading/Shared.hpp

-15
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ class Shared
4444
void push(T const & val);
4545
inline T peek() const { return _val; }
4646

47-
operator T() [[deprecated("Use 'pop()' instead.")]];
48-
void operator = (T const & val) [[deprecated("Use 'push()' instead.")]];
49-
5047
private:
5148

5249
T _val;
@@ -94,16 +91,4 @@ void Shared<T,QUEUE_SIZE>::push(T const & val)
9491
}
9592
}
9693

97-
template<class T, size_t QUEUE_SIZE>
98-
Shared<T,QUEUE_SIZE>::operator T()
99-
{
100-
return pop();
101-
}
102-
103-
template<class T, size_t QUEUE_SIZE>
104-
void Shared<T,QUEUE_SIZE>::operator = (T const & val)
105-
{
106-
push(val);
107-
}
108-
10994
#endif /* ARDUINO_THREADS_SHARED_HPP_ */

‎src/threading/Sink.hpp

-5
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ class SinkBase
4040

4141
virtual T pop() = 0;
4242
virtual void inject(T const & value) = 0;
43-
44-
inline operator T() [[deprecated("Use 'pop()' instead.")]]
45-
{
46-
return pop();
47-
}
4843
};
4944

5045
template<typename T>

‎src/threading/Source.hpp

-8
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ class Source
4545
void connectTo(SinkBase<T> & sink);
4646
void push(T const & val);
4747

48-
void operator = (T const & val) [[deprecated("Use 'push()' instead.")]];
49-
5048
private:
5149
std::list<SinkBase<T> *> _sink_list;
5250
};
@@ -72,10 +70,4 @@ void Source<T>::push(T const & val)
7270
});
7371
}
7472

75-
template<typename T>
76-
void Source<T>::operator = (T const & val)
77-
{
78-
push(val);
79-
}
80-
8173
#endif /* ARDUINO_THREADS_SOURCE_HPP_ */

0 commit comments

Comments
 (0)
Please sign in to comment.