MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / int_

Class int_

extern/pybind/include/pybind11/pytypes.h:1871–1904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1869PYBIND11_NAMESPACE_END(detail)
1870
1871class int_ : public object {
1872public:
1873 PYBIND11_OBJECT_CVT(int_, object, PYBIND11_LONG_CHECK, PyNumber_Long)
1874 int_() : object(PyLong_FromLong(0), stolen_t{}) {}
1875 // Allow implicit conversion from C++ integral types:
1876 template <typename T, detail::enable_if_t<std::is_integral<T>::value, int> = 0>
1877 // NOLINTNEXTLINE(google-explicit-constructor)
1878 int_(T value) {
1879 if (sizeof(T) <= sizeof(long)) {
1880 if (std::is_signed<T>::value) {
1881 m_ptr = PyLong_FromLong((long) value);
1882 } else {
1883 m_ptr = PyLong_FromUnsignedLong((unsigned long) value);
1884 }
1885 } else {
1886 if (std::is_signed<T>::value) {
1887 m_ptr = PyLong_FromLongLong((long long) value);
1888 } else {
1889 m_ptr = PyLong_FromUnsignedLongLong((unsigned long long) value);
1890 }
1891 }
1892 if (!m_ptr) {
1893 pybind11_fail("Could not allocate int object!");
1894 }
1895 }
1896
1897 template <typename T, detail::enable_if_t<std::is_integral<T>::value, int> = 0>
1898 // NOLINTNEXTLINE(google-explicit-constructor)
1899 operator T() const {
1900 return std::is_unsigned<T>::value ? detail::as_unsigned<T>(m_ptr)
1901 : sizeof(T) <= sizeof(long) ? (T) PyLong_AsLong(m_ptr)
1902 : (T) PYBIND11_LONG_AS_LONGLONG(m_ptr);
1903 }
1904};
1905
1906class float_ : public object {
1907public:

Callers 9

enum_nameFunction · 0.85
initFunction · 0.85
pybind11.hFile · 0.85
export_valuesFunction · 0.85
dtypeMethod · 0.85
sliceMethod · 0.85
index_to_objectMethod · 0.85
finalizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected