Skip to content

Commit 0c950a6

Browse files
Deepikaadbridge
authored andcommitted
Default constructor for template class should be part of header file
1 parent cc7e16c commit 0c950a6

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

drivers/MbedCRC.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ namespace mbed {
2424

2525
/* Default values for different types of polynomials
2626
*/
27-
template <uint32_t polynomial, uint8_t width>
28-
MbedCRC<polynomial, width>::MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder):
29-
_initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), _crc_table(NULL)
30-
{
31-
mbed_crc_ctor();
32-
}
33-
3427
template<>
3528
MbedCRC<POLY_32BIT_ANSI, 32>::MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder):
3629
_initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder),

drivers/MbedCRC.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ class MbedCRC
124124
* polynomials with different intial/final/reflect values
125125
*
126126
*/
127-
MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder);
127+
MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder) :
128+
_initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data),
129+
_reflect_remainder(reflect_remainder), _crc_table(NULL)
130+
{
131+
mbed_crc_ctor();
132+
}
128133
MbedCRC();
129134
virtual ~MbedCRC()
130135
{

0 commit comments

Comments
 (0)