remove harmful createPIPair()
This commit is contained in:
@@ -124,19 +124,6 @@ inline PICout operator<<(PICout s, const PIPair<Type0, Type1> & v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! \~english Creates \a PIPair object, deducing the target type from the types of arguments.
|
|
||||||
//! \~russian Создает \a PIPair выводя типы из аргументов.
|
|
||||||
//! \~\details
|
|
||||||
//! \~\code
|
|
||||||
//! auto p = createPIPair(1, 'a');
|
|
||||||
//! piCout << p; // (1, a)
|
|
||||||
//! \endcode
|
|
||||||
template<class T1, class T2>
|
|
||||||
PIPair<T1, T2> createPIPair(const T1 & f, const T2 & s) {
|
|
||||||
return PIPair<T1, T2>(f, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//! \~english Creates \a PIPair object, deducing the target type from the types of arguments.
|
//! \~english Creates \a PIPair object, deducing the target type from the types of arguments.
|
||||||
//! \~russian Создает \a PIPair выводя типы из аргументов.
|
//! \~russian Создает \a PIPair выводя типы из аргументов.
|
||||||
//! \sa \a createPIPair()
|
//! \sa \a createPIPair()
|
||||||
|
|||||||
54
main.cpp
54
main.cpp
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
using namespace PICoutManipulators;
|
using namespace PICoutManipulators;
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char * argv[]) {
|
||||||
/*PISerial ser;
|
/*PISerial ser;
|
||||||
ser.setSpeed(PISerial::S115200);
|
ser.setSpeed(PISerial::S115200);
|
||||||
@@ -18,9 +17,54 @@ int main(int argc, char * argv[]) {
|
|||||||
ser.startThreadedRead();
|
ser.startThreadedRead();
|
||||||
(2_s).sleep();
|
(2_s).sleep();
|
||||||
ser.stopAndWait();*/
|
ser.stopAndWait();*/
|
||||||
PISet<int> set = {1, 3, 4};
|
|
||||||
set |= PISet<int>{2, 4};
|
/*auto test = [](PISystemTime t) {
|
||||||
set -= PISet<int>{2};
|
piCout << "---------------";
|
||||||
piCout << set << (set & PISet<int>{1, 2, 4});
|
piCout << t << t.toString();
|
||||||
|
piCout << PISystemTime::fromString(t.toString()) << PISystemTime::fromString(t.toString()).toString();
|
||||||
|
piCout << PIVariant(t);
|
||||||
|
piCout << PIVariant(t).toString();
|
||||||
|
};
|
||||||
|
auto test_str = [](PIString s) {
|
||||||
|
piCout << "---------------";
|
||||||
|
piCout << s;
|
||||||
|
piCout << PISystemTime::fromString(s) << PISystemTime::fromString(s).toString();
|
||||||
|
};
|
||||||
|
|
||||||
|
test(PISystemTime::current());
|
||||||
|
test(1000.123_d);
|
||||||
|
test(61_s);
|
||||||
|
test(59_s);
|
||||||
|
test(1234_us);
|
||||||
|
test(5000001_ns);
|
||||||
|
|
||||||
|
test_str("");
|
||||||
|
test_str("2020-05-04");
|
||||||
|
test_str("2020-05-04 11:12:13");
|
||||||
|
test_str("11:12:13");
|
||||||
|
test_str("11:12:13.405");
|
||||||
|
test_str("100");
|
||||||
|
test_str("5 s");
|
||||||
|
test_str("5s");
|
||||||
|
test_str("1000 d 2 h 57 m 7 s 200 ms 2 ns");
|
||||||
|
test_str("0.2 d");
|
||||||
|
test_str(".5d");
|
||||||
|
test_str("3E+2us");
|
||||||
|
test_str("0.1d 200millis");
|
||||||
|
test_str("2h 15 seconds");
|
||||||
|
test_str("4secs 2hours 100 ns 3m 5ms 1 day 6 micros ");
|
||||||
|
|
||||||
|
test_str("1hz");
|
||||||
|
test_str("5.123khz");
|
||||||
|
test_str("5khz 123 hz");
|
||||||
|
test_str("2mhz");
|
||||||
|
test_str("1ghz");
|
||||||
|
test_str("1hz 1hz");*/
|
||||||
|
|
||||||
|
// PIPair<int, PIString> p = createPIPair(0, "");
|
||||||
|
PIVector<PIPair<int, PIString>> pv;
|
||||||
|
pv << createPIPair(0, PIString());
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user